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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser Validation - mozilla

Status
Not open for further replies.

zealand

Technical User
Sep 17, 2001
5
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top