PDA

View Full Version : How do I load one page if the browser is IE and a different page for Netscape?


tesscm
02-20-2005, 10:47 AM
I just put a up a new site that looks great in Internet Explorer, but some pages look funny in Netscape. Any ideas how to check the browser and load one page for IE and a different page for Netscape?

chilipie
02-20-2005, 11:48 AM
Bad idea. These "browser snifers" as they are known, are often used to block certain browsers from sites. Any way, Opera (and probably other browsers) can spoof them, so that the sniffer thinks that they're using a different OS/browser.

If your site looks funny, try validating (http://validator.w3.org/) your pages. Silly mistakes are often made, which can easily be corrected, and then your site may look fine.

Post back and tell us how you get on :) .

rmedek
02-20-2005, 12:59 PM
Are you using CSS? If not, you should be... it'll make it really easy to get both browsers looking good. You can serve up regular styles to Mozilla (Netscape) and send an alternate stylesheet to Internet Explorer via conditional comments...