PDA

View Full Version : Browser detect page switcher?



gnubler
29 Dec 2006, 02:27 PM
I'm presently recoding an entire site from tables to CSS and I'm considering using a bit of Javascript to detect older browsers and redirect them to the old table-based site. Normally I wouldn't really fuss with this, but in this case my two bosses - the people paying me to make websites for them - are running dinosaur Macs with IE5, which completely chews up my CSS layouts. So, I thought I'd just silently redirect them to the table version.

I've Googled a bit about Javascript browser detect, but what I want to ask the forum is which browsers & versions should I include in this? Which ones handle CSS horribly?

Thanks.

Rambo Tribble
30 Dec 2006, 05:12 PM
IE is probably your biggest concern. I might suggest IE conditional comments (http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp) to catch older IE versions and feed them different CSS rules, or even redirect the page.

Using a JavaScript redirect is dicey as it may not be active on a user's system. The browser normally reports its identity (though that may be spoofed) to the server, which is probably a better place to make such discriminations, but is probably still less reliable and elegant that conditional comments.