views:

435

answers:

4

iframes are not supported in xhtml strict. However, in my application I am using php recaptcha which requires the use of iframes. What are the downsides of just switching to xhtml transitional (if any)?

+1  A: 

Nothing, really. In practical terms, when it comes to browser compatibility, functionality, and tool/generator friendliness, XHTML 1.0 Transitional (following the "HTML compatibility" guidelines and served as text/html) is your best bet.

hobbs
A: 

Here you have an small comparison that can help you regarding each type of document.

But in "practical" terms if you want to keep your site using strict, why just add the iframe. the only issue with this is that page wont be correctly validated

Gabriel Sosa
+2  A: 

Has hobbs said, there is no practical downside. However, theoretically the strict DTD is more "future-proof".

Here's a link to a quick fix in PHP that will make recaptcha valid XHTML 1.0 Strict:

http://www.boriel.com/2009/07/29/xhtml-strict-valid-recaptcha/

rogeriopvl
awesome! thanks!
I'd be curious (legitimately curious, not "internet I'm questioning your intelligence by using the word curious" curious) to your thinking on the strict DTD is more future proof. Both are standards, which implies there's equal political repercussions to dropping both, and my gut says there's more documents out there authored XHTML transitional, which is another nod towards its future 'proffness.
Alan Storm
I say "future-proof" because in terms of standards, W3C expects that the presentation attributes and elements (present in transitional DTDs) will be phased out.It's not something guaranteed, but is something desirable for a better web. If you keep your XHTML or HTML strict chances are that you won't need any changes to your websites in long-term, and also ensure that browsers will use their strictest, most standards compliant rendering modes.Here's a link on the subject:http://24ways.org/2005/transitional-vs-strict-markup
rogeriopvl
At the time HTML4 was written, it was thought that iframes would be phased out in future. As for whether that's still their plan today, it probably isn't. Use transitional if you like, but have a good understanding about which features are 'deprecated' and avoid them where there's a better alternative.
thomasrutter
A: 

At the time HTML4 was written, it was thought that iframes would be phased out in future.

However, that was a long time ago, and it looks like that is no longer the case. Thus, you could say that the 'strict' subset is no longer as accurate a representation of the future of HTML/XHTML as it once was.

Use transitional if there's a reason you need some of its features, but have a good understanding about which features are 'deprecated' and in general avoid them where there's a better alternative.

Note that browser support for transitional features implemented today probably isn't going to disappear in my lifetime. Backward compatibility has proven a tough nut to crack on the web.

thomasrutter