Re: unknown tag

Foteos Macrides (
Mon, 22 Apr 1996 08:51:40 -0500 (EST)

Date: Mon, 22 Apr 1996 08:51:40 -0500 (EST)
From: Foteos Macrides <>
Subject: Re: unknown tag
Message-Id: <01I3U3MAE5C2006HC2@SCI.WFBR.EDU> wrote:
>i found the tag
><!-- // --> <h1>Your browser does not support <a
>/script_info/">JavaScript</a>, sorry</h1>.
><!-- // -->The conversion table below will not work with your browser<p><hr>
>in the <head> tag. it seems that this tag can contain text which is
>displayed only if the client's browser is anything else than >=netscape
>on the other side it looks like a simple comment....
>however i could not find any documentation anywhere.
>would appreciate any advice.

	Take a look at:

                              HTML3 Scripting
                        W3C Working Draft 08-Feb-96
   This version:

   Latest version:

          Dave Raggett <>
          Based on an initial draft by Charlie Kindel, and in turn
          derived from the Netscape extensions for JavaScript
          this will be added to as we evolve the draft
    --- rough draft --- --- rough draft --- --- rough draft ------ rough

	The suggestion to use commenting to hide the SCRIPT code from
SCRIPTnorant clients is "not unreasonable" if it were augmented with
clear caveats.  For pre-2.0 Netscape clients and clients based on CERN
libwww SGML.c parsing, you have "historical" comment parsing, which
is a euphamism for "no concept of a comment".  The "<!--" or, in fact,
"<!anything" creates an "unknown tag" situation, so that it, and
everyting up to the next '>' is ignored.  All you have to do for those
clients is make sure no '>' appears in the script itself.  For example,
where you might have used "a > b" use "b < a" so that the '>' in the
"-->" is the only one before the </SCRIPT>.

	For SCRIPTnorant clients which do support comment parsing, you
in theory should simply need to avoid use of "--" in favor of other code
for decrementing a variable, so that the "--" is not misinterpreted as
a comment delimiter, instead of the one at the end that is followed by
'>' with nothing or only white space interposed.  The problem, though,
is ignorance about valid comment parsing on the part of some user agent
developers, and too many document providers who use Netscape as a
"validator" of their markup.  Note the use of "---" between the
"rough draft" alerts above, which are OK there because they are not in
a comment element.  Many of the example scripts at Netscape, and many
documents "guided" by those example, do include "decorative" dashes
within the comment element for "hiding" SCRIPT content, messing up
other clients which VALIDLY treat dash pairs in a comment block as
delimitors, not decorations.

	The 08-Feb-96 draft also suggests use of use an SGML marked
section to hide the script statements:

<![ %if-script [
  function square(i) {
    document.write("The call passed ", i ," to the function.","<BR>")
    return i * i
  document.write("The function returned ",square(5),".")

which is theoretically correct, but for a large number of clients
in the present real world creates a situation like that for "historical"
comment parsing.  The "<![" will be treated as an unknown tag, and
occurrences of '>' in the script could end the hiding, instead of
it continuing to the '>' in "]]>".


 Foteos Macrides            Worcester Foundation for Biomedical Research
 MACRIDES@SCI.WFBR.EDU         222 Maple Avenue, Shrewsbury, MA 01545