[thelist] JavaScript Browser Detect not working

Chris Blessing webguy at mail.rit.edu
Wed Mar 13 12:21:01 CST 2002


Aaron,

I tested it out and it appears to work up until you call your GetCookie()
function.  Try this and it should work with NS4:

if ((navigator.appName == "Netscape") &&
(navigator.appVersion.substring(0,2) == "4.")) {
	alert("4.!");
	/*
	if ( GetCookie("Notice") != "done" ) {
		OpenWin = this.open("../include/browser_notice.jsp", "notice",
"toolbar=no,menubar=no,location=no,scrollbars=yes,resize=no,width=500,height
=300");
	}
	*/
}

Show us your GetCookie() code and we'll see what's up! =)  Also, if you're
not looking for subversions of NS4, you could get away with
parseInt(navigator.appVersion) instead of using the substring() method.

hth,

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net


> It is supposed to be a simple browser-detect that opens a pop-up
> window when
> the user's browser is Netscape 4x.  This was written by contract engineers
> that my company uses.  We're meeting today and I'd like to have a little
> knowledge going into it.




More information about the thelist mailing list