Using conditional comments as described in the article will actually hide the nested Object from all browsers:
<!--[if !IE]>
<object></object>
<![endif]-->
Therefore, it should be constructed in the following way in order to hide the nested Object only from Internet Explorer. However, this method won't validate which means it can't be used in XHTML 2.0:
thank you also share here. I hope all of science can be useful here. "Indonesia Furniture Handicraft Wholesale Marketplace":http://qampus.blogspot.com/2010/05/indonesia-furniture-handicraft.html
I can't comment on xhtml but I've tested all the examples above as plain HTML and they don't work! However there is a syntax for 'down-level' (Microsofts' obnoxious label for browsers that aren't IE) CC's that works AND validates:
<!--[if gte IE 6]><!-->
Seen by all real browsers and IE 6. Validates as HTML 4.01 Transitional and possibly other doctypes
<!--<![endif]-->
Tested and working on Firefox 1.5, Opera 7.5, IE6, Konqueror and Lynx.
The only problem I've found with this code is that it confuses the syntax highlighter built into the CFML module for Eclipse (causing it to render the remaining page in comment green).
Thanks to Stu at cssplay.co.uk for finding this. I don't know where he found it but I'm grateful anyway. As usual the MS documentation was completely useless and even google failed to turn up much of value.
I double-checked my example. It does indeed work, at least with the german version of IE 6. I have no idea whether this hack will work with any other version of IE. What version of IE did you use for testing?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
</head>
<body>
<!--[if !IE]> -->
IE doesn't see this.
<!-- <![endif] -->
</body>
</html>
I checked this with ie6 on winxp, and ie5.5 on win98, both in the german version.
I also tried your example and the conditional comments do also work there.
strange...
cheers
Florian
I just realized something else. The example we've been playing with thus far uses a transitional doctype as it doesn't validate using a strict doctype. Something about character data not being allowed there according to the validator.
XHTML 2 won't have a transitional mode (as far as I'm aware), so it seems that you can't use conditional comments anyways to deal with IE's broken Object support.
"I just realized something else. The example we've been playing with thus far uses a transitional doctype as it doesn't validate using a strict doctype. Something about character data not being allowed there according to the validator."
XHTML does not allow character data at the <body> level. It must be within a block level element such as
conditional comments has always seemed sort of an ugly hack to me, although if the focus starts to shift from IE as the development target of choice to IE as a legacy browser then they become perhaps more useful.