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

Redirects?

Status
Not open for further replies.

SViper

Technical User
Feb 7, 2001
2
US
I need some help please.
I am trying to make a redirect script that sniffs out NS4, NS6, IE4+ and Opera. It also needs to find that NS4 and NS6 are different and send them to different urls.
I tried a keyword search here, but it seems to be offline.

Here is what I have so far but it sends NS4 and NS6 to the same place. (or at least it did until NS6 went belly up on me...now NS6 gives me the appcomps.dll fault)

*/

var browser_type=navigator.appName
var browser_version=parseInt(navigator.appVersion)

//if NS 4+
if (browser_type=="Netscape"&&browser_version>=4)
window.location.replace("ns4.htm")
//if NS 6+
if (browser_type=="Netscape"&&browser_version>=5)
window.location.replace("ns6.htm")
//if IE 4+
else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
window.location.replace("ie.htm")
//Default goto page (NOT NS 4+ or NOT IE 4+ or NOT NS 5+)
else
window.location="svright.htm"


Thanks,
Tom
 
You are getting NN6 following the first option, beause it fits that too, since it IS >=4, and >=4, use a getElementById clause - if it exists -NN6. Or document.layers, only NN version ,6 has that.

Are you serious about Opera? That should be easy to detect.
BB "Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer"
 
So if I move the NN6 detection above the NN4, then it should be ok?

I have no way of testing it since Nutscratch 6 is so farged up that I can't run it on my system.

As for Opera, yes... I have V5.02 and I have only found 2 minor quirks that keep me from making it my regular browser.
I figure, as picky as I am, if I like it, then many others will soon be using it. Also, the reviews I have seen are none short of praise.
It is fast, sturdy, and quite compatible with todays web sites.
I don't think it wise to overlook this one. ;)

Tom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top