W3C home > Mailing lists > Public > www-validator@w3.org > July 2002

Re: <script> and <noscript> in xhtml

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sun, 28 Jul 2002 16:46:24 +0200
To: François Battail <francois.battail@wanadoo.fr>
Cc: www-validator@w3.org
Message-ID: <it08ku853o1179r0jtr72nfu7epf8kusk9@4ax.com>

* François Battail wrote:
>I've just tried to validate some code written in xhtml 1.1 like this :
>
>...
><div id="someID">
>   <script type="text/javascript">
>   <!--
>     document.write (myJSFunction ()) ;
>   // -->
>   </script>
>   <noscript>
>     Some text here for non javascript enabled browsers
>   </noscript>
></div>
>...

Take a look at section C.4 of http://www.w3.org/TR/xhtml1/

>and the validator is telling me:
>Some text here for non javascript enabled browsers
>^
>Error: text is not allowed here; try wrapping the text in a more 
>descriptive container
>
>and:
>
></noscript>
>^
>Error: missing a required sub-element of "noscript"
>
>
>Error: text is not allowed here; try wrapping the text in a more 
>descriptive container
>
>Am I missing something? From the recommendations (html4, 4.01; xhtml 1 
>strict, xhtml 1.1) the <noscript> is still alive...

The validator does not complain about the noscript element, but you must
not use character data in noscript element, the validator wants you to
write something like

  <noscript><p>...</p><noscript>
Received on Sunday, 28 July 2002 10:46:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:03 GMT