01-14-2004, 08:37 PM
I am getting Netscape 7.x where I think it is Netscape 7.1
How can I write conditions to this browser?
Here is an example that works with Netscape 7.0:
if(navigator.appName.toLowerCase().indexOf("netscape") > -1 && navigator.vendorSub.indexOf("7.") > -1)
Can I use the same with Netscape 7.1??
01-14-2004, 09:23 PM
That condition would still work ok for later versions of Netscape 7 (but there won't be any later versions, it's a dead browser now and there'll be no further versions).
The construct you're using though begs the question of why you're doing that kind of browser sniff, that's not a good way to determine which code your web page should use because the last Netscape browser was based on the Gecko rendering engine and there are more (and still available) browsers using that engine than just the now defunct Netscape browser.
01-16-2004, 02:05 PM
If that is the case what is the best way to check for Netscape 7.1?
01-16-2004, 02:56 PM
The best way is not to.
But it depends on what you're doing and why you need to - if you're scripting, then object or feature detection are probably more appropriate; if you're writing CSS then maybe you want a way of applying something only to mozilla browsers (including netscape 7)
So can you expand on what your particular requirements are?