Detect browser version in javascript

Discussion in 'Javascript' started by Andy, May 31, 2005.

  1. Andy

    Andy Guest

    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
    Andy, May 31, 2005
    #1
    1. Advertising

  2. Andy

    Ian Leow Guest

    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).
    Ian Leow, May 31, 2005
    #2
    1. Advertising

  3. 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.
    Michael Winter, May 31, 2005
    #3
  4. Andy

    Randy Webb Guest

    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
    Randy Webb, May 31, 2005
    #4
  5. Andy

    Randy Webb Guest

    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 + '<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
    Randy Webb, May 31, 2005
    #5
  6. 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
    Thomas 'PointedEars' Lahn, Jun 6, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZG90bmV0dGVzdGVy?=

    Detect if cookies/javascript are disabled on client browser

    =?Utf-8?B?ZG90bmV0dGVzdGVy?=, Jan 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    671
    =?Utf-8?B?ZG90bmV0dGVzdGVy?=
    Jan 16, 2006
  2. V Green
    Replies:
    0
    Views:
    811
    V Green
    Feb 5, 2008
  3. PA Bear [MS MVP]
    Replies:
    0
    Views:
    913
    PA Bear [MS MVP]
    Feb 5, 2008
  4. MowGreen [MVP]
    Replies:
    5
    Views:
    1,988
    PA Bear [MS MVP]
    Feb 9, 2008
  5. Replies:
    0
    Views:
    470
Loading...

Share This Page