PDA

View Full Version : Need help with displaying image depending on browser


shaitiger
03-11-2009, 09:56 PM
Does anyone here know of the ASP code I'd use in a situation where I didn't want to display a certain image when the client is using IE6? I'm fine with displaying it in IE7 and Firefox, but don't want it displayed in IE6. Any help would be much appreciated. thanks!!

Old Pedant
03-12-2009, 05:15 AM
Best way is to detect the browser type using JavaScript and then just use JS coding to suppress it in MSIE 6.

Now, what do you do about all those billions (okay, tiny exaggeration) of WebTV users? And Safari? And Netscape 4.7? And...

I have to admit, I'm really curious why you would exclude MSIE 6, of all browsers. It's actually well-behaved compared to some of the weirder ones.

shaitiger
03-12-2009, 02:27 PM
It's mainly because of IE6's issue with PNGs with transparent backgrounds. I want it displayed with all browsers except for IE6. I hope that makes sense. Is there another way of doing this? Thanks

Old Pedant
03-12-2009, 11:25 PM
MS has a browser detection componen that will give you the current browser's capabilities. Not sure if it tells you the actual browser name/version.

quick search on MSDN gives us:

http://msdn.microsoft.com/en-us/library/ms531077(VS.85).aspx

No, doesn't look like that will tell you name/version.

So unless you can find a 3rd party component to do this, a roll-your-own with JS help looks like best idea.