View Full Version : JavaScript and XHTML

12-31-2005, 11:01 AM
We are all being pushed one way or another towards standardization.
To this end I am attempting to make my documents XHTML compliant.

I currently use, as part of my program, the language version of JavaScript.

<code><script language="JavaScript1.5"></code>

This however is not accepted within the XHTML standard.

The standard is now:

<code><script type="text/javascript"></code>

Is there a way to return the version being used and still be XHTML compliant?

I can still enter:

<code><script language="JavaScript1.5" type="text/javascript"></code>

However this no longer differentiates between the different versions as the type statement overrides the language statement.

Any thoughts?


Bill Posters
12-31-2005, 11:29 AM
You could/should now be using object detection (http://developer.apple.com/internet/webcontent/objectdetection.html) instead of js versioning.

What do you intend each 'version' to do?

DHTML Kitchen
01-01-2006, 03:04 AM
JS 1.5 has stuff like try / catch. That's not possible to detect in earlier versions without an error.

01-02-2006, 05:28 PM
But why would you need to? What browser worth considering uses an older version than 1.5?