javascript_howto thread: Javascript versions and compabillity...
Well,
I like the idea, but unfortunately, these things pop up...
Also, it's not that easy. As opposed to what I wrote below,
there are some (a few) features that ONLY work if you specify
"JavaScript1.2" in
Netscape 4... :-(
But good luck!
Med v=E4nliga h=E4lsningar! (Swedish)
/Robert
-----Original Message-----
From: STG@e... [mailto:STG@e...]
Sent: den 16 januari 2002 10:42
To: JavaScript HowTo
Subject: [javascript_howto] RE: Javascript versions and compabillity...
Oh dear...
Well what I was intending to do was to write a macro for my favourite
editor (freeware/shareware: www.notetab.com) - one where you can
add clips.
This macro (so far) looks like this - if you download notetab and try
to
add a clip you may want to see my idea in practice:
-------------------------
^!Set %browser%=3D^?[Browser version=3D_None specified|Navigator
2.0|Navigator
3.0|Navigator 4.0-4.05|Navigator 4.06-4.7x|Navigator 6.0 |Mozilla (open
source browser)]
^!If ^%browser% =3D "Navigator 2.0" ^!Set %js%=3D"JavaScript 1.0"
^!If ^%browser% =3D "Navigator 3.0" ^!Set %js%=3D"JavaScript 1.1"
^!If ^%browser% =3D "Navigator 4.0-4.05" ^!Set %js%=3D"JavaScript 1.2"
^!If ^%browser% =3D "Navigator 4.06-4.7x" ^!Set %js%=3D"JavaScript 1.3"
^!If ^%browser% =3D "Navigator 6.0" ^!Set %js%=3D"JavaScript 1.5"
^!If ^%browser% =3D "Mozilla (open source browser)" ^!Set
%js%=3D"JavaScript
1.5"
^!If ^%browser% =3D "None specified" ^!Set %js%=3D"JavaScript"
<script language=3D"^%js%">
<!--
// Optimized for ^%browser% (and above.)
^&
// -->
</script>
-------------------------
I could just change the if-sentence to give just
'language=3D"javascript"' if
people choose netscape 4... (though some of my idea is not so smart
then :
-)
Med venlig hilsen (Yours faithfully in danish)
Sten Hougaard
EDB Gruppen
Application developer/web-designer
"Nyman, Robert"
<Robert.Nyman@i... To: "JavaScript HowTo"
<javascript_howto@p...>
Bizkit.se> cc:
Subject:
[javascript_howto]
RE: Javascript versions and
01/16/2002 compabillity...
10:31 AM
Please respond
to "JavaScript
HowTo"
Good initiative,
but there's a small problem regarding this:
In Netscape 4, if you specify version, the JavaScript interpreter
misinterprets some
stuff that will work otherwise.
"...specifying a LANGUAGE attribute of "JavaScript1.2" makes navigator
4
behave in ways that
are not compatible with previous browsers and not compatible with the
ECMA
specification.
For this reason, you may want to avoid specifying "JavaScript1.2" as a
value
for the
LANGUAGE attribute".
Excerpt from David Flanagans JavaScript: The Definitive Guide (3rd
edition)
For more information, read his book:
JavaScript: The Definitive Guide
(http://www.oreilly.com/catalog/jscript4/)
(4th edition out now)
Sincerely,
Robert Nyman
-----Original Message-----
From: STG@e... [mailto:STG@e...]
Sent: den 16 januari 2002 09:24
To: JavaScript HowTo
Subject: [javascript_howto] Javascript versions and compabillity...
Hi,
When you write javascript code it is a good practice to specify which
javascript you are building your code on. It is done this way:
<script language=3D"JavaScript1.1"></script>
Obiously for version 1.1 :-)
Can anyone help complete this list of compabillities between
JS/Browser's:
JavaScript 1.0
Netscape : Navigator 2.0
Microsoft: ?
JavaScript 1.1
Netscape : Navigator 3.0
Microsoft: ?
JavaScript 1.2
Netscape : Navigator 4.0-4.05
Microsoft: ?
JavaScript 1.3
Netscape : Navigator 4.06-4.7x
Microsoft: ?
JavaScript 1.4
Netscape : -
Microsoft: ?
JavaScript 1.5
Netscape : Navigator 6.0
Netscape : Mozilla (open source browser)
Microsoft: ?
All my information about Netscape/Mozilla comes from:
http://developer.netscape.com/docs/manuals/js/core/jsref15/preface.html#
1003
152
Thanx,
Med venlig hilsen
Sten Hougaard
EDB Gruppen
Application developer/web-designer
$subst('Email.Unsub').
$subst('Email.Unsub').
$subst('Email.Unsub').