Browser detection and redirect

Does anyone know where I can find a really good browser detection and redirect script? And yes I know this is DD and this is kinda not the place for it. but eh sue me. I am searching and cannt find a real good one.

i would ask lost…i think he did something like it.

hopefuly he pops in or someone knows of a link

why don’t you use javascripts ? i dont really see another way…
dreamweaver’s redirection script seem ok to me =)

DW has one?? where?

Yeah I wanna use JS

yeah i didnt know they had one? can you tell us where?

This belongs in Server-Side scripting, so I will move it…

And yes, I did something like that before…

http://www.kirupa.com/web/browser_detect.htm

hey LIB cool script. But I have a question. How does your script define what is oldns and newns? Like if I want everyone using ns6.0 and below to go here and 6.0 and above go there? I guess what is old and new to your script?

oldNS is anything below NS6. NS6 introduced the ability to use getElementByID, which IE uses as well, but anything before that didn’t have it. So my script checks to see if the version of NS has getElementByID or not.

Ok one last question. So for ie It considers 5.5 new and anything below old or is it 5.0? ANd I take it if it is Opera or some one like that it will just go ahead ad let them thru?

Expansion…

var IE = document.all;

IE has the ability to check the entire document for an object using document.all. So if the browser has that ability, it is IE

var oldNS = document.layers;

oldNS (5-) could had the ability to use layers, so if the browser had the ability to use document.layers, it must be an old NS browser.

var newNS = !document.all && document.getElementById;

The new NS (6+) pretty much has the same ability as IE, but it can’t use the document.all ability. So if it can’t use the document.all ability and it can use getElementById, then it must be a new NS version

var opera = window.opera;

Opera is retarded.

Theres an explantion of how the vars work to check the browser.

A key note: Opera must ALWAYS come first inthe set of if statements. Otherwise it will return the IE page.

*Originally posted by 3d-iva *
**Ok one last question. So for ie It considers 5.5 new and anything below old or is it 5.0? ANd I take it if it is Opera or some one like that it will just go ahead ad let them thru? **

It doesn’t check old or new IE. Just IE in general. For IE that is really all you need, there shouldn’t be complications.

Opera… you can define your own opera page, otherwise use the IE page.