| 
	
 | 
 Posted by Toby Inkster on 02/05/06 18:55 
Alan J. Flavell wrote: 
> Toby Inkster wrote: 
>  
>> And with a little creativity, you could serve up a transparent GIF  
>> to any browsers with "MSIE" in their user-agent string, and a PNG to  
>> everyone else. 
>  
> Don't do that - it's bad in principle, and works badly in practice. 
> For all the usual reasons. 
 
Pah! I'll agree that detecting browser by user-agent string is generally 
rather hit-and-miss, but this is one particular application where 
user-agent matching won't cause any problems. 
 
Potential pitfall #1: a non-IE browser has "MSIE" in the user-agent string 
and gets sent a GIF instead of a PNG. This isn't a huge problem -- the 
only browser that does this by default is Opera, but this will change in 
version 9.0. And when a browser does do this, it gets the GIF, which 
should still look fairly good -- just not as good as the PNG. 
 
Potential pitfall #2: vice-versa. It is possible, but difficult to change 
the u-a string for MSIE. But because it's quite tricky, not many people 
will have done it, so not really worth worrying about. Besides which, the 
only problem they'll experience in this case will be cosmetic. 
 
--  
Toby A Inkster BSc (Hons) ARCS 
Contact Me  ~ http://tobyinkster.co.uk/contact
 
  
Navigation:
[Reply to this message] 
 |