Re: <script> and <noscript> in xhtml

* 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 UTC