Holden Caulfield wrote:
I agree that doing object detection is usually better than using
version detection.
You bet! http://pointedears.de.vu/scripts/test/whatami
However, in answer to the original question, you could declare a
variable and then test for increasing versions of javascript such as
this:
<script language="javascript1.1">
<!--
var jsver = 1.1
// -->
</script>
<script language="javascript1.2">
<!--
jsver = 1.2
// -->
</script>
[and on and on until Nth version of javascript...]
Whatever "jsver" is at the end is your highest version CLAIMED to be
understood.
I have misguidedly used that years ago. And now -- what should it be
good for if not reliable? It is exactly the wrong way and thus returns
the wrong results. For example, IE 6.0 SP-1 on Win2k claims to support
JavaScript 1.5 but it does not support (not even with updated JScript
engine) core features specified there and in ECMAScript 3. Besides, the
above is invalid HTML 4 as the type attribute is missing, and it will
not validate as HTML 4.01/XHTML 1.0 Strict as the "language" attribute
is deprecated. OTOH, it is unlikely that you get a result even near to
truth if you use both the "language" and the "type" attribute.
PointedEars