Click to See Complete Forum and Search --> : Version number craziness


arasburn
07-26-2004, 12:43 PM
Hi,

I have been using the below code to capture the browser version:

browserVer=parseInt(navigator.appVersion)

For some reason when using IE6 I get 4 returned!

The full string returned when parseInt is removed is:

4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

Please can someone explain why this comes back as 4 instead of 6?

Thanks in anticipation,
Ady

AdamGundry
07-26-2004, 12:50 PM
I forget why, but all versions of Internet Explorer from 4 onwards always report their version to be 4.0, as you have seen. I guess it could be to ensure compatibility with earlier browser-detection scripts.

You can test for IE 6.0 for example like this:

navigator.appVersion.indexOf("MSIE 6.0")

Adam

arasburn
07-26-2004, 03:11 PM
Hi Adam,

am not too sure if this is good forum etiquette, but thanks for your reply - it worked a treat!

cheers
Ady