Re: using Javascript with STRICT DTD

by "Peter Newton" <c-newton(at)ihug.co.nz>

 Date:  Sun, 28 Jan 2001 17:31:47 +1300
 To:  <hwg-techniques(at)hwg.org>
 References: 
  todo: View Thread, Original
Thanks everyone,

<.script type="text/javascript">

Works for both the strict AND the transitional DTD's

and it makes sense since javascript is mentioned in the type tag

Many Thanks
Peter Newton



> On or about 11:13 AM 01/28/2001 +1300, Peter Newton alleged:
>
> >I'm familiarising myself with the STRICT DTD  Document type using the W3C
> >
>  Which STRICT DTD?  HTML 4.0, HTML 4.01, XHTML 1.0....
>
> >validator and I get the following error:-
> >
> ><SCRIPT LANGUAGE="JavaScript" type="text/javascript">
> >                   ^
> >Error: there is no attribute "LANGUAGE"
> >
> >I've always specified the language in my script tags because other script
> >languages exist. Can anyone throw some light on this and offer a solution
> >that also works with the transitional DTD.
> >
>  You receive that error because the language attribute for the script tag
> was replaced by the type attribute.  If you remove the type attribute
> you'll receive a "required attribute 'type' missing" error.  The scripting
> language is now set in the second "half" of the type attribute value
(after
> the forward slash).
>  For STRICT DTDs use <script type="text/javascript">.
>  Set up a test page with 3 script tags using the different attribute
> combinations (language, type, and language & type).  Now validate it under
> different DTDs and you'll see which attribute is allowed/forbidden under
> which DTD.
>
> --
>  Regards,
>  Dave Kennedy
>  Beaumont Texas USA
> ====================
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA