|
-
Sep 28th, 2001, 08:21 PM
#1
Thread Starter
Member
Detect IE Version
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!
-
Sep 28th, 2001, 10:43 PM
#2
Frenzied Member
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 bringing geeky back...
-
Sep 30th, 2001, 09:31 PM
#3
Thread Starter
Member
OK did that, but the page just sits there after load. Where do I tell it which page to redirect to?
-
Sep 30th, 2001, 09:37 PM
#4
Thread Starter
Member
Nevermind I figured it out lol.
-
Sep 30th, 2001, 09:38 PM
#5
Member
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"
Did you write that convoluted crap Justin?
-
Sep 30th, 2001, 09:50 PM
#6
Frenzied Member
Originally posted by filburt1
Did you write that convoluted crap Justin?
I'm better in JS than i am at VB
I'm bringing geeky back...
-
Sep 30th, 2001, 09:56 PM
#7
Originally posted by filburt1
Did you write that convoluted crap Justin?
another usless post
-
Sep 30th, 2001, 09:58 PM
#8
Frenzied Member
Originally posted by scoutt
another usless post
another misspelled word
I'm bringing geeky back...
-
Sep 30th, 2001, 10:08 PM
#9
Member
Originally posted by scoutt
another usless post
So was that.
-
Sep 30th, 2001, 10:53 PM
#10
Originally posted by filburt1
So was that.
about 99.9% of mine aren't though, unlike yours.
JP good one
-
Oct 1st, 2001, 03:23 PM
#11
PowerPoster
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
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|