By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

Detect browser version in javascript

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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).

Jul 23 '05 #2

P: n/a
On 31/05/2005 11:47, Ian Leow wrote:
(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

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3

P: n/a
Andy wrote:
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?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #4

P: n/a
Ian Leow wrote:
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[i] + '<br>');
}

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

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #5

P: n/a
Andy wrote:
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
Jul 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.