[thelist] Re: Browser Detection

Seb seb at admin.evolt.org
Fri Feb 23 11:05:00 CST 2001


> You may also want to do some reading on browser detection, such as The
> Ultimate JavaScript Client Sniffer, as noted by other evolters. You should
> also keep in mind that asking visitors to go get another browser and come
> back to view your site is an easy way to make sure they go away and don't
> come back. It would be better to test your site in different
> browser/version/platform combinations, and where possible, use browser
> detection to fix the parts that break in certain combinations. And even
this
> won't help you with browsers that have JavaScript disabled.

If you've got access to any kind of server-side scripting, it's better to do
the detection server-side, and redirect as appropriate. You need to parse
the HTTP User-Agent string, which generally looks something like:

User-Agent: Mozilla/5.001 (windows; U; NT4.0; en-us) Gecko/25250101

eg: in Perl, you can do this with $ENV{HTTP_USER_AGENT}, other platforms
vary, so check your docs.

Because you're doing it server-side, there are no worries that client
scripting might be turned off, and you can ensure that users are redirected
appropriately.

<Seb/>





More information about the thelist mailing list