From: Peter Michaux on
On May 6, 1:35 pm, Steve <tinker...(a)gmail.com> wrote:
> Hi;
>
> I've being going through some legacy code on an old JSP site I have
> been patching. I noticed that when I save the JSP down to my PC as an
> HTML file I get this javascript error in IE 6 ( not in the latest
> Firefox ):
>
> "invalid character"
>
> The problem traces back to this line of code:
>
> <SCRIPT TYPE="text/javascript" SRC="abc/jsp/blah.js"></SCRIPT>
>
> It goes away if I remove the "text/".

That is strange. I've never had a problem. Is the "blah.js" file in
some strange character encoding?


> I have never seen a script tag with "TYPE" or "text/javascript"
> used. Only "language = "javascript""
>
> What is <SCRIPT TYPE="text/javascript" used for? Is it necessary?

This is a bit of a tricky area. In mid 2006(?) the official type was
approved as "application/javascript" however everyone had been using
"text/javascript" and so there will be a transition period before
using "application/javascript" is the norm.

The type attribute is required by the HTML spec

http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.2.1

so if you want your page to validate as HTML

http://validator.w3.org/

you will need to include the type attribute.

-----------

Just in case you are new to validation, before you have a chance to
get excited about XHTML for the general web

http://www.thewebcreator.net/2007/04/16/why-you-should-be-using-html-401-instead-of-xhtml/
http://www.webdevout.net/articles/beware-of-xhtml

Also HTML 5 is almost surely the future of the web. XHTML just didn't
have a good chance with how strict it is and without support in
Internet Explorer, I guess.

Peter
From: RobG on
On May 7, 8:02 am, Stevo <n...(a)mail.invalid> wrote:
> Thomas 'PointedEars' Lahn wrote:
> > Steve wrote:
> >> Only "language = "javascript""
> > But using that ranges from being deprecated to invalid nowadays.
> > PointedEars
>
> Which browser(s) treat language="javascript" as invalid?

Thomas isn't referring to browsers, he's talking about
specifications. See Richard Cornford's reply to the OP.


--
Rob