Anyone know the java code to do this? I want to redirect people using below ver. 5 of IE to one page and above ver. 5 to another page.
Thanks!
Printable View
Anyone know the java code to do this? I want to redirect people using below ver. 5 of IE to one page and above ver. 5 to another page.
Thanks!
Add this as a script:
function 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.returnValue=false; }
}
Then add this to the BODY tag:
onLoad="checkBrowser(4.0,0,0,4.0,1,0,0,'33','');return document.returnValue"
OK did that, but the page just sits there after load. Where do I tell it which page to redirect to?
Nevermind I figured it out lol.
Did you write that convoluted crap Justin? :DQuote:
Originally posted by jpbtennisman
Add this as a script:
function 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.returnValue=false; }
}
Then add this to the BODY tag:
onLoad="checkBrowser(4.0,0,0,4.0,1,0,0,'33','');return document.returnValue"
I'm better in JS than i am at VB ;)Quote:
Originally posted by filburt1
Did you write that convoluted crap Justin? :D
another usless postQuote:
Originally posted by filburt1
Did you write that convoluted crap Justin? :D
another misspelled word :DQuote:
Originally posted by scoutt
another usless post
So was that. :rolleyes:Quote:
Originally posted by scoutt
another usless post
about 99.9% of mine aren't though, unlike yours.Quote:
Originally posted by filburt1
So was that. :rolleyes:
JP good one :D
For those interested:
I found this earlier, it is a good resource for detecting browser versions.
http://www.mozilla.org/docs/web-deve...wser_type.html