Detect browser version in javascript

A

Andy

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 any way of getting this
using javascript?

If not, can anybody suggest how i could go about getting it?

many thanks in advance,

andy
 
I

Ian Leow

As far as I know, no. Since what you are looking for is an IE browser,
you might want to use JScript or VBScript if they are capable of
detecting the browser's minor version (note that other browsers, such
as FireFox and Netscape, will ignore JScript and VBScript scripts).
 
M

Michael Winter

(note that other browsers, such as FireFox and Netscape, will ignore
JScript and VBScript scripts).

When properly identified, a user agent should ignore a language it
doesn't understand. However, JScript is merely another implementation of
ECMAScript, like Mozilla's JavaScript, and many other implementations.

Other user agents may ignore Microsoft-specific extensions like
conditional comments, but not the basic language itself.

Mike
 
R

Randy Webb

Andy said:
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 any way of getting this
using javascript?
No.

If not, can anybody suggest how i could go about getting it?

var IEVerNumber = prompt('What revision IE do you have?','Click
Help>About Internet Explorer and it will show it to you')

Meaning, you ask the user. Or, you have the ActiveX Control determine
whether it can execute what it wants to or not.

What exactly are you trying to do?
 
R

Randy Webb

Ian said:
As far as I know, no. Since what you are looking for is an IE browser,
you might want to use JScript or VBScript if they are capable of
detecting the browser's minor version.

JScript and Javascript, in IE, are synonymous.

for (i in navigator){
document.write(i + ' = ' + navigator + '<br>');
}

Will show you the information that is available from the navigator
object and the Revision Number is not one of them.
 
T

Thomas 'PointedEars' Lahn

Andy said:
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 any way of getting this
using javascript?

No. The HTTP-User-Agent header and so the `userAgent' property of the
object referred to by the global proprietary `navigator' property can
be forged.
If not, can anybody suggest how i could go about getting it?

Since it more depends on the ActiveX version installed instead of the UA
version (note that Netscape 4+ supports ActiveX as well), it would be more
reasonable to cure the illness instead of the symptoms. Why not check for
the ActiveX support and version and handle missing support accordingly?


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top