Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Simple snif: == version 5.0 or >

    Hi,

    I am looking for a very short coded sniffer which only detects:

    == version 5.0 or > version 5.0

    version 6.0 detection etc not necessary

    I already snif for browser / os , but i do not want the version snif implemented within it, just separate.

    The shorter the better!

    Thanks for your effort,
    Jerome

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The following should work as a sniifer for IE5 and later.

    ie5plus = document.getElementById && document.all

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry Roy, I didn't explane well what I want, my mistake!

    I like to have a routine like:

    if(version == 5.0)
    {
    }
    else // (version > 5.0) //
    {
    }

    Jerome

  • #4
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I made a line myself which seems to work in IE 5.0, although the code is longer the expected...

    Can somebody test it using IE 5.5 or higher

    <html>
    <head>
    </head>
    <body>

    <script type="text/javascript" language="JavaScript1.2">
    agent=navigator.userAgent.toLowerCase();
    if((parseInt(navigator.appVersion)==4)&&(agent.indexOf("msie 5.0")!=-1))
    {
    document.write("You use IE 5.0");
    }
    else //should be IE 5.5 +
    {
    document.write("You use IE 5.5 or higher");
    }
    </script>
    </body>
    </html>

    Thanks in advance,

    Jerome

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    your checking for ie5 is correct. but you can't just say that it's ie5.5+ in the else statement. It might be ie4 or netscape or other browsers.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Glenngv,

    Thanks for replying,

    I do have a secure sniffer for os / browser / version which only continue to show the site when os == win, browser == ie, version >= 5.0.

    For one layout-problem (DIV over (not above but over) IFRAME) I need to detect if the IE version == 5.0 (DIV over IFRAME not possible because of z-index not supported) or >= 5.5 (z-index for IFRAMES supported)

    Can you test of the code works with IE 5.5 + , I use IE 5.0 (I think I am the only one in this forum not using state of the art technology)

    Thanks
    Jerome

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quíet Storm Designs ~ Art is not what you see, but what you make others see.
    · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

  • #8
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quiet Storm,

    Most, most interesting, I am directly going to implement this!

    Thanks for Your effort,
    Jerome


  •  

    Posting Permissions

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