views:

358

answers:

2

I'm gleaning from this question [http://stackoverflow.com/questions/599334/facebook-connect-wont-validate] that using Facebook Connect and other facebook 'social widgets' just doesn't result in a 'valid' document.

Concerning (X)HTML5, however, what would be the (most) appropriate doctype/header if I want to include Facebook Connect content on my pages, and be as close to 'valid' (X)HTML5 as possible?

+1  A: 

If you're using XHTML5, then you don't need to include a DOCTYPE. You can include <!DOCTYPE html> if you like, but it's not necessary. You simply need to specify the XHTML namespace, and the namespace for Facebook Connect.

I'm not familiar with Facebook Connect at all, but you will need to make sure the document is processed as XML, which means serving it with an XML MIME type like application/xhtml+xml. (The text/html serialisation does not support namespaces).

The HTML5 validator will not be able to check the conformance of the facebook markup, but it should still be able to check the conformance of the XHTML. Elements from other namespaces are allowed to be included, even though the HTML5 validator does not support them.

Lachlan Hunt
+1  A: 

There is no proper way.

Ms2ger