nextgates
Junior Member
CISCO CCNA & CCNP Certified
Posts: 430
inherit
45437
0
Nov 19, 2007 20:03:59 GMT -8
nextgates
CISCO CCNA & CCNP Certified
430
June 2005
mnagy
|
Help!!
Jun 19, 2005 13:04:30 GMT -8
Post by nextgates on Jun 19, 2005 13:04:30 GMT -8
bnp42.proboards37.com<script language="JavaScript"> // Check Browser code v1 by TDR // Feel free to post this code anywhere. <!-- function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0 var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr); if (app.indexOf('Netscape') != -1) { if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;} else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;} } else if (app.indexOf('Microsoft') != -1) { if (version >= IEvers || verStr.indexOf(IEvers) != -1) {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; } } //--> </script> <body onLoad="MM_checkBrowser(4.0,1,1,4.0,0,1,1,'PAGE URL','');return document.MM_returnValue"> How can I make that code detect FireFox, not IE?
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Help!!
Jun 19, 2005 14:50:01 GMT -8
Post by Peter on Jun 19, 2005 14:50:01 GMT -8
The first if function is doing that. Mozilla app name will return Netscape.
A shorter way...
<script type="text/javascript"> <!--
if(!document.all){ // Non IE browser stuff here } else { // IE stuff here }
//--> </script>
That would be a better way then above, as FF can be changed to act like IE. An even better way would be to check the user agent as well.
|
|