I need to add firefox 1.0 as an acceptable browser for my website. I have the following validation code:
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v5.0
var newURL='', userAgent=navigator.userAgent, version=0;
if (userAgent.indexOf('Netscape') != -1) {
version = parseFloat(userAgent.substring(userAgent.indexOf('Netscape')+9,userAgent.length));
if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
} else if (userAgent.indexOf('MSIE') != -1) {
version = parseFloat(userAgent.substring(userAgent.indexOf('MSIE')+4,userAgent.length));
if (version >= IEvers)
{if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
} else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}
called by: onLoad="MM_checkBrowser(4.0,2,0,4.0,0,2,2,'','netscape.cfm')
Any ideas on how to adapt the code to include firefox?
thanks,
Paul
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v5.0
var newURL='', userAgent=navigator.userAgent, version=0;
if (userAgent.indexOf('Netscape') != -1) {
version = parseFloat(userAgent.substring(userAgent.indexOf('Netscape')+9,userAgent.length));
if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
} else if (userAgent.indexOf('MSIE') != -1) {
version = parseFloat(userAgent.substring(userAgent.indexOf('MSIE')+4,userAgent.length));
if (version >= IEvers)
{if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
} else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}
called by: onLoad="MM_checkBrowser(4.0,2,0,4.0,0,2,2,'','netscape.cfm')
Any ideas on how to adapt the code to include firefox?
thanks,
Paul