Facebook Connect and HTML5, xmlns available?

anonymous coward picture anonymous coward · Jul 4, 2009 · Viewed 11.5k times · Source

Facebook Connect and their "Social Widgets" documentation mention that you need to add an xmlns attribute to your <html> tag on the page where it will be used.

I understand that xmlns is for XML Name-spacing, and have used such with XHTML before. However, with all the recent talk about HTML4 / HTML5, without having read through the entire spec, is the xmlns attribute compatible with valid HTML5? What about HTML4?

If I've looked over an obvious mention of this in the docs, I'm sorry... point it out?

EDIT: A couple docs references/cites:

http://developers.facebook.com/news.php?blog=1&story=198

https://developers.facebook.com/docs/guides/web

Answer

dennisdegryse picture dennisdegryse · Aug 7, 2010

I've had the same problem using HTML5 for facebook connect and solved with a small hack on Facebook's JavaScript API.

Read my blog: http://fbml5.blogspot.com/

The method on the dev wiki (mentioned by Jesus Saldivar) has two things which I don't like:

  • it requires an extra javascript call per html tag. My method only needs a html tag.
  • it needs invalid attributes in the tags, so the final html code is invalid. My method uses the user-data attributes to avoid invalid html.

Please tell me what you think of it.