[thelist] hiding an HTML attribute with IE-condition?

Zhang Weiwu zhangweiwu at realss.com
Tue Aug 24 12:51:15 CDT 2010


On 2010年08月23日 19:40, James Hardy wrote:
> Well, the easy solution that springs to mind is to cheat a little, and write
> the opening object tag twice using IE conditional comments, on to show only
> on IE, and one to be hidden in IE 5+ (I think it is safe to ignore IE4-)
>
> <!--[if IE]>
> <object>
> <parameter src="video.wmv">
> <![endif]-->
>
> <![if !IE]>
> <object data="video.wmv">
> <![endif]>
>   

I guess this won't work. Because conditional comments are totally
ignored by non-IEs. E.g. Firefox would read your code like this:

<object>
<parameter src="video.wmv">

<object data="video.wmv">

Then it is understood as two "objects".

The problem is now more or less "solved" now by preparing a video in a
second format (ogg) and use "video" tag for Firefox.




More information about the thelist mailing list