Click to See Complete Forum and Search --> : Detect NS6
sail3005
Jan 13th, 2001, 12:01 AM
How would i detect netscape 6 within a javascript, and distingush between netscape 4.7 and earlier, with NS6?
for example:
//var IE = (document.all)? 1 : 0;
//var NS = (document.layers)? 1: 0;
Mark Sreeves
Jan 15th, 2001, 10:28 AM
Why do you need to determine if NS6 is being used?
navigator.appVersion returns 5.0 (Windows; en-US) for ns 6 and 4.02 [en] (WinNT; I ;Nav) for ns 4.2 so
with ns6
var ns = (document.layers)? 1: 0;
is set to 0 !
var app = navigator.appName;
var ver = navigator.appVersion;
document.write(app + "<BR>")
document.write(ver+ "<BR>")
var ie4 = (document.all)? true : false;
var ns4 = (document.layers)? true : false;
var ns = (app == "Netscape");
var ns6 = ns && (navigator.appVersion.charAt(0)== 5)? true : false;
document.write('IE 4: ' + ie4 + "<BR>");
document.write('Netscape: ' + ns + "<BR>");
document.write('Netscape 4: '+ ns4 + "<BR>");
document.write('Netscape 6: ' + ns6 + "<BR>");
this displays:
IE5:
Microsoft Internet Explorer
4.0 (compatible; MSIE 5.01; Windows NT)
IE 4: true
Netscape: false
Netscape 4: false
Netscape 6: false
netscape 4:
Netscape
4.02 [en] (WinNT; I ;Nav)
IE 4: false
Netscape: true
Netscape 4: true
Netscape 6: false
netscape 6:
Netscape
5.0 (Windows; en-US)
IE 4: false
Netscape: true
Netscape 4: false
Netscape 6: true
is this of any help to you?
Mark Sreeves
Jan 17th, 2001, 02:49 AM
DID MY LAST REPLY HELP?
If you don't give me any feed-back I won't bother answering your questions in future!!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.