IPv6 Launchipv6 ready

Validating XHTML with RDFa and Facebook like button 

If you are trying to validate a XHTML+RDFa page with W3C's validator tool you'll receive an error stating that iframes are not compatible with the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> doctype.

The workaround if you are using JQuery is to append that iframe after the DOM is fully loaded. Here is a sample code how we're doing this:

$('.facebookLike').after('<iframe src="your-url-goes-here" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height: 70px;"></iframe>');

You must have an element with defined class right after which the JQuery will append the iframe. It could be a simple <span class="facebookLike"></span>.

Also the above javascript code must be within included javascript file and not directly in the HEAD tag.

Here is a link with validated page using this workaround:

Comments - Validating XHTML with RDFa and Facebook like button

Add Comment

Fill out the form below to add your own comments.

Insert Special:

Moderation is turned on for this blog. Your comment will require the administrators approval before it will be visible.

Tagged as: , , , , , , ,

<Back Next>