Is this legal?

Discussion in 'Javascript' started by G., Jan 30, 2006.

  1. G.

    G. Guest

    Earlier, I blamed Python for being unable to parse this, but just to be
    sure, is this legal HTML (at least the part with " // </ht ml> " ?


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html><head><title>Choke on this</title>
    <script language="JavaScript">
    <!--
    // </ht ml> - this is a comment in JavaScript
    -->
    </script>
    </head>
    <body>
    Hey there
    </body>
    </html>
     
    G., Jan 30, 2006
    #1
    1. Advertising

  2. G. wrote:

    > Earlier, I blamed Python for being unable to parse this, but just to be
    > sure, is this legal HTML (at least the part with " // </ht ml> " ?
    >
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <html><head><title>Choke on this</title>
    > <script language="JavaScript">
    > <!--
    > // </ht ml> - this is a comment in JavaScript
    > -->
    > </script>


    According to SGML/HTML rules the first </ closes the opening <script>
    tag so that </ht will close the opening <script>:
    <http://www.w3.org/TR/html4/types.html#type-cdata>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 30, 2006
    #2
    1. Advertising

  3. G.

    cwdjrxyz Guest

    Martin Honnen wrote:
    > G. wrote:
    >
    > > Earlier, I blamed Python for being unable to parse this, but just to be
    > > sure, is this legal HTML (at least the part with " // </ht ml> " ?
    > >
    > >
    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > > <html><head><title>Choke on this</title>
    > > <script language="JavaScript">
    > > <!--
    > > // </ht ml> - this is a comment in JavaScript
    > > -->
    > > </script>

    >
    > According to SGML/HTML rules the first </ closes the opening <script>
    > tag so that </ht will close the opening <script>:
    > <http://www.w3.org/TR/html4/types.html#type-cdata>


    Also http://www.htmlhelp.com/tools/validator/problems.html#script may
    be of some interest. Not observing the SGML requirement described here
    is responsible for many complaints that the W3C and other validator
    services receive that claim the validator is making an error, which in
    fact it is not. It is just that in this case many browsers will display
    the page properly despite the error.
     
    cwdjrxyz, Jan 30, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Valentin Tihomirov

    Is this legal?

    Valentin Tihomirov, Oct 21, 2003, in forum: VHDL
    Replies:
    20
    Views:
    1,285
    Jan Decaluwe
    Oct 29, 2003
  2. Divyang M
    Replies:
    9
    Views:
    674
    Divyang M
    May 18, 2005
  3. Divyang M
    Replies:
    1
    Views:
    588
    Jerzy Gbur
    May 15, 2005
  4. Weng Tianxiang
    Replies:
    12
    Views:
    1,472
  5. =?Utf-8?B?RGF2ZQ==?=

    Legal ViewState Characters

    =?Utf-8?B?RGF2ZQ==?=, May 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    387
    Patrice
    May 24, 2004
Loading...

Share This Page