Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect (only) Netscape 6.01

Status
Not open for further replies.

Halling

Programmer
Jul 2, 2003
15
SE
I need to detect Netscape 6.01. I have an old script that does the trick:

Code:
var app;
var ver;
app = navigator.appName;
ver = navigator.appVersion;

if ( app.indexOf("Netscape") != -1 && ver.indexOf("5.0") != -1 )

The problem that I noticed is that it triggers on my Firefox browser, thinking that I run Netscape 6.01. Any idea on how I can get the script to only trigger on a true Netscape 6.01?

I’m afraid that if I do a fix that sorts out my Firefox browser, there is another browser or version out there that triggers it. I don’t want to keep patching the script for many years to come each time I find a new browser that messes it up...
 
Not having NN 6.01 installed makes it hard for me to give you the exact details, but try something like this:

Code:
var app = navigator.appName;
var ua = navigator.userAgent;
if (app == 'Netscape' && ua.indexOf('Netscape/6.0') != -1)

You might have to tweak the "/6.0" to be "/6.01" or whatever (you can alert the ua variable to see what is put in).

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
It solved the problem in Firefox. I don´t know if the script is still working in Netscape 6.01 since I don’t have that version of Netscape my self to test it on. My dad has that version of Netscape on his computer, I have to wait for him to check it in his browser. But he is on vacation...
 
There is a bug in that version; it can’t handle international charters coded with Unicode correct. Now I don’t remember if it can’t handle Unicode correctly at al, or if it was only in combination with JavaScript.

I open a new window with a script, and am sending text with the international charters as Unicoded parameters when opening the window (now I don’t remember why I use Unicode and not any other encoding, but at the time I figured out that it was the only way that was working in al browsers). It works in al browsers, except for Netscape 6.01, where the Unicode it self is shown in the text, not the symbols it’s representing.

Now it is a long time since I originally made the script, but back then I found this to be a known bug in Netscape 6.01, and not an error by me.
 
Is it something you really need to fix? Do you have users that still use such an archaic browser? If so, why not simply advise them to upgrade to something more modern?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Well, my dad still runs that old version. So, yes, there exist users that still use it!

And the script is actually for displaying a text telling the user to upgrade or be prepared for miss-formatted text.

I put kind of an honour in that al my web pages shall work in al browsers, even old, and in al resolutions down to 800x600. It’s a bit more work, but it gives a result that I can be proud of! :)
 
Sometimes it's really not worth the effort... and I would say supporting NN 6.01 isn't really worth the effort. If your dad is the only person that uses it, encourage him to upgrade to a newer verision - perhaps even a better browser, such as Firefox 1.5.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top