473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do you find out what version of JavaScript your browser supports?

How do you find out what version of JavaScript your browser supports?
Is there a JavaScript function that will tell you?

__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003
Jul 20 '05 #1
5 3032
wylbur37 <wy************@yahoo.com> writes:
How do you find out what version of JavaScript your browser supports?
You don't.

Technically, only Netscape's browsers supports a "version of
JavaScript", since they are the ones defining the JavaScript
versions. The versions are summarized here:
<URL:http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/preface.html#1003515>

Microsoft browsers have different versions of JScript, which is mostly
compatible with Netscape's JavaScript. They use their own version
numbers.
<URL:http://msdn.microsoft.com/library/en-us/script56/html/js56jsoriversioninformation.asp>

Other browsers implement their version of ECMAScript + DOM and call it
Javascript, e.g., Opera. They have no version numbers for the Javascript,
it just evolves with the browser.
The core language is pretty fixed by now, as everybody are
implementing ECMAScript v3. The differences are in the interface to
the browser and document, i.e., the DOM.
Is there a JavaScript function that will tell you?


No.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
It's worth looking at the version info in the property sheet for
C:\WINDOWS\SYSTEM32/jscript.dll

--
######################
## PH, London ##
######################
Lasse Reichstein Nielsen wrote:
wylbur37 <wy************@yahoo.com> writes:
How do you find out what version of JavaScript your browser supports?
You don't.

Technically, only Netscape's browsers supports a "version of
JavaScript", since they are the ones defining the JavaScript
versions. The versions are summarized here:

<URL:http://devedge.netscape.com/library/...pt/1.5/referen
ce/preface.html#1003515>
Microsoft browsers have different versions of JScript, which is mostly
compatible with Netscape's JavaScript. They use their own version
numbers.
<URL:http://msdn.microsoft.com/library/en...6jsoriversioni
nformation.asp>
Other browsers implement their version of ECMAScript + DOM and call it
Javascript, e.g., Opera. They have no version numbers for the
Javascript, it just evolves with the browser.
The core language is pretty fixed by now, as everybody are
implementing ECMAScript v3. The differences are in the interface to
the browser and document, i.e., the DOM.
Is there a JavaScript function that will tell you?


No.

/L

Jul 20 '05 #3
wylbur37 hu kiteb:
How do you find out what version of JavaScript your browser supports?
Is there a JavaScript function that will tell you?


The best approach is to test within your script for the presence of the
fucntion you want to use, rather than testing for a version number. In
other words, test for what it can do, rather than for what it says it
can do.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #4
I agree that doing object detection is usually better than using
version detection.

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.

Holden
Jul 20 '05 #5
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
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: R. Smits | last post by:
I've have got this script, the only thing I want to be changed is the first part. It has to detect IE version 6 instead of just "Microsoft Internet Explorer". Can somebody help me out? I tried...
5
by: Christian Ista | last post by:
Hi, Is it possible to check if the javascript is turn on on the browser (IE, firefox, ...)? Thanks, Christian,
13
by: Alex Molochnikov | last post by:
Is there any way to find out programmatically if Javascript is supported/enabled in a browser? By "programmatically" I mean on the Java servlet side. TIA Alex Molochnikov Gestalt Corporation
5
by: Andy | last post by:
Hi, I'm trying to use javascript to detect the version of internet explorer before running an active x control. I'm after the full version number (eg not just IE6 but 6.0.2800.1106). Is there...
4
by: Java Guy | last post by:
I can find a lot of stuff on the internet about javascript, except how to I determine which version my IE6 is compatible with, or where to download javascript plugin/engine/what-ever for Windows...
5
by: Mufasa | last post by:
We want to keep track of what OS/Browser people are using for our website. How can I find that out so that I can write it to a DB ? I know how to get it into the DB; I just need to know how to get...
5
by: YaoBao | last post by:
Is any ColdFusion script I can put on my webpage that will create a search bar so people can type keywords to match it on the current page in my website? It will be exactly like the finder search bar...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.