...

View Full Version : JavaScript and XHTML



Dr.Strangelove
12-31-2005, 10: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?

Tom

Bill Posters
12-31-2005, 10: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, 02:04 AM
JS 1.5 has stuff like try / catch. That's not possible to detect in earlier versions without an error.

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum