[thelist] XHTML and language="javascript"

James Aylard evolt at pixelwright.com
Wed Jun 18 16:53:29 CDT 2003

Mike Combs wrote:

> I've been declaring <script language="javascript"
> type="text/javascript" src="myfile.js">.  I read somewhere that I
> should retain the language attribute for compatibility with older
> browsers, but now I can't remember just which browsers I'm protecting
> here.  Should I drop the language attribute?  What browsers require
> the language attribute?

    Virtually any browser that sees a <script> element without a language
attribute will default to JavaScript. Even Internet Explorer, the only major
browser of which I am aware that supports a language other than JavaScript,
will default to JavaScript (or JScript) when no language is specified. The
vast majority of script-enabled user agents in use today do understand the
type attribute of the script element, so you will alienate very, very few --
if any -- browsers that will digest your pages.

James Aylard
evolt at pixelwright.com

More information about the thelist mailing list