XHTML Strict alternative to iframe!

This is to continue from the post I read here: http://www.sitepoint.com/forums/showthread.php?447748-XHTML-Strict-1-0-alternative-to-iframe

Almost everyone that responded frustrated me SOO much that I joined to reply - only to find it is a closed subject. No one really helped. If you have comments such as ‘just go transitional’ then DONT EVEN BOTHER!
Obviously he would have considered that! Did you not think that maybe he spent HOURS changing his code to Strict to find only one bit makes him need to go back to transitional?

There is a REAL solution. Tested in Strict and +RDFa.


<!--[if !IE]><!-->
	<object data="http://www.link.com/" type="text/html" width="320" height="240"></object>
<!--<![endif]-->
<!--[if IE]>
	<iframe frameborder="0" src="http://www.link.com/" width="320" height="240"></iframe>
<![endif]-->

I don’t want to start any argument here, but you kind of missed the point. Your solution only validates because the validator ignores comments. So why would it complain about your use of an iframe when it is commented out?

iframe is not permitted under Strict, which is what the original poster found out and was trying to find a solution to. The object tag was the appropriate solution/tag as that is permitted under Strict, however, at the time of the original posting IE didn’t support it very well (it might not still – I’m uncertain about that).

Either way, the proposed solution you have, will pass a validator, but is dependent on the browser running conditional comments to inject an acceptable tag if not IE, and an unacceptable tag if it is IE and it definitely does not abide by the rules for Strict, it does abide by Transitional though.

Like was mentioned the IFRAME does NOT appear within: http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict Hence if somebody attempted to directly write let’s say: IFRAME or EMBED (or some other mythical element, i.e. KANGAROO) within a XHTML 1.0 Strict Document type it of course won’t validate against the vanilla DTD because it isn’t referenced anywhere there.

If you want to both; deceive yourself and the W3C Validation service? Thus go against the philosophy of a Strict document by littering the document with Deprecated Elements. Hidden by either Script or Comment Delimiters, e.g. http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4 you have achieved nothing but deception on both counts.

Even if one chose the Extensibility route and wrote IFRAME into a Customised DTD, it would be of little gain since it appears in Transitional, all it achieves in nothing of benefit but to prove the web author likes using Deprecated elements, which of course is just bad practice (just to bypass the validator) and the path to the Dark side.

I don’t see the point in the comments. What’s wrong with just using an iframe?

Ooooh, the validator’s gonna whine. So? Validator’s just a tool for web devs to find their mistakes. If your iframe is deliberate because nothing else does the job, it’s not a mistake, just invalid, which doesn’t actually matter as far as HTML is concerned.
It’s HTML. Not C.

As Wikipedia says: be bold. Use your iframe in the open. No jack-booted w3 storm trooper standarista thugs are going to bust into your bedroom in the night time and take you away to the Validation Camps with a black bag over your head. Or, that’s what I’ve was promised when I joined the HTML Working Group.

IE8 and above fully support the use of the object tag for the purpose so that the iframe tag will become completely unnecessary once IE7 is dead. The only thing you can’t control using object instead of iframe even in IE7 is that using the object tag means that you have no way to turn off the border around the embedded HTML content that the object is displaying.

I didn’t know that. But if you can’t turn off border that pretty much makes it unusable in most cases yeah.

I used to care about the validator. Now, as you will eventually, I could care less. Simple is better.