[thelist] HTML Formatting/HTML Compliance (Script Tag)

Ben Dyer ben_dyer at imaginuity.com
Fri Nov 30 09:36:11 CST 2001


On 09:25 AM 11/30/2001, Burhan Khalid said to me:
>Important note about scripting/css in XHTML. If you are going to use 
>inline scripts/css (as in, not from an external file), and you use uses < 
>or & or ]]> or --, then your document will not validate. You have to 
>escape your inline scripts withing the <![CDATA[ ]]> tags.

<tip author="Ben Dyer" type="XHTML Compliance">
But, if you want to validate your XHTML and still handle the really old 
browsers that don't correctly support the <script> tag,  use this instead:

<script language="JavaScript" type="text/javascript">
<!-- <![CDATA[
   function whatever() {
     // Code
   }
// ]]> -->
</script>

It validates and it works in older browsers.
</tip>

--Ben


-----------------------------------------------------------------
Ben Dyer, Senior Internet Developer, Imaginuity Interactive
http://www.imaginuity.com/
-----------------------------------------------------------------
Condemant quod non intellegunt. | Falso en uno, falso en omnibus.
-----------------------------------------------------------------





More information about the thelist mailing list