Results 1 to 11 of 11

Thread: Detect IE Version

  1. #1

    Thread Starter
    Member Chipcrap's Avatar
    Join Date
    Mar 2001
    Posts
    52

    Detect IE Version

    Anyone know the java code to do this? I want to redirect people using below ver. 5 of IE to one page and above ver. 5 to another page.


    Thanks!

  2. #2
    Frenzied Member JungleMan's Avatar
    Join Date
    Feb 2001
    Posts
    2,033
    Add this as a script:
    function checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
    var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
    if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
    } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
    {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
    } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
    if (newURL) { window.location=unescape(newURL); document.returnValue=false; }
    }



    Then add this to the BODY tag:

    onLoad="checkBrowser(4.0,0,0,4.0,1,0,0,'33','');return document.returnValue"
    I'm bringing geeky back...

  3. #3

    Thread Starter
    Member Chipcrap's Avatar
    Join Date
    Mar 2001
    Posts
    52
    OK did that, but the page just sits there after load. Where do I tell it which page to redirect to?

  4. #4

    Thread Starter
    Member Chipcrap's Avatar
    Join Date
    Mar 2001
    Posts
    52
    Nevermind I figured it out lol.

  5. #5
    Originally posted by jpbtennisman
    Add this as a script:
    function checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
    var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
    if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
    } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
    {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
    } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
    if (newURL) { window.location=unescape(newURL); document.returnValue=false; }
    }



    Then add this to the BODY tag:

    onLoad="checkBrowser(4.0,0,0,4.0,1,0,0,'33','');return document.returnValue"
    Did you write that convoluted crap Justin?

  6. #6
    Frenzied Member JungleMan's Avatar
    Join Date
    Feb 2001
    Posts
    2,033
    Originally posted by filburt1


    Did you write that convoluted crap Justin?
    I'm better in JS than i am at VB
    I'm bringing geeky back...

  7. #7
    scoutt
    Guest
    Originally posted by filburt1


    Did you write that convoluted crap Justin?
    another usless post

  8. #8
    Frenzied Member JungleMan's Avatar
    Join Date
    Feb 2001
    Posts
    2,033
    Originally posted by scoutt

    another usless post
    another misspelled word
    I'm bringing geeky back...

  9. #9
    Originally posted by scoutt

    another usless post
    So was that.

  10. #10
    scoutt
    Guest
    Originally posted by filburt1


    So was that.
    about 99.9% of mine aren't though, unlike yours.

    JP good one

  11. #11
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    For those interested:

    I found this earlier, it is a good resource for detecting browser versions.

    http://www.mozilla.org/docs/web-deve...wser_type.html

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width