View Full Version : Simple snif: == version 5.0 or >

02-27-2003, 01:25 PM

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,

Roy Sinclair
02-27-2003, 10:07 PM
The following should work as a sniifer for IE5 and later.

ie5plus = document.getElementById && document.all

02-28-2003, 06:44 AM
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) //


02-28-2003, 08:06 AM
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


<script type="text/javascript" language="JavaScript1.2">
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");

Thanks in advance,


02-28-2003, 09:07 AM
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.

02-28-2003, 10:09 AM

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)


Quiet Storm
02-28-2003, 11:19 PM
What about this?:


03-01-2003, 07:12 PM
Quiet Storm,

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

Thanks for Your effort,

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum