views:

619

answers:

2

Is it possible to validate iFrames in xhtml 1.0 strict? Preferably without any use of javascript to inject the iframe into the page.

I know there is no point in validating just for the sake of validation, but lets just say that I like the green validation message on w3c ;) (I am forced by factors beyond my control to use iframes)

Or maybe there is something very similar I can use in xHTML to get iframe-like behavior without losing compatibility across different browsers? (object?)

Perhaps there is a way to add a second doctype containing iframe rules?

+2  A: 

i'm not sure but I think you can include another page with object as you suggest.

<object data="/another.html" type="text/html"></object>
SpliFF
To clarify on this: It won't work in IE, that's why I'm now using <!--[if IE]> to show it as an iframe in IE. The object will be used in other browsers. Technically the iframe will be a comment though, so it validates!
Wonderful - duplication of effort and hacks to hide content from the validator. It would be much easier to just use Transitional (or fix the design to not use iframes).
David Dorward
no, i agree with the OP. If it's a comment then it is not a part of the DOM, and compliant browsers can use it in a compliant way. A few extra lines of code is a small price for supporting IE, the most non-compliant browser in existence.
SpliFF
You can be compliant without having to support two different methods for achieving the same thing by using Transitional.
David Dorward
A: 

If you need iframes, use Transitional instead of Strict. The point of it is for when you need to use legacy features like iframes.

David Dorward