Facebook Connect and HTML5, xmlns available?

对着背影说爱祢 提交于 2019-12-01 03:08:00

The below answer is from 2009. It discusses the state of HTML 5 at the time.

The above question is also from 2009. It discusses the state of the Facebook APIs at the time.

Neither are relevent for 2017.


is the xmlns property

It's an attribute.

compatible with valid HTML5?

Sort of. It is completely meaningless, but allowed so people can be lazy when porting XHTML.

Remember that HTML 5 is an unfinished draft. These things are subject to change. Don't rush into using HTML 5 unless it offers a serious benefit.

What about HTML4?

Not at all.

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.

Actually, the first cited reference discusses adding a xmlns:fb="http://www.facebook.com/2008/fbml" attribute. This is not valid HTML5. It is valid XHTML5. The second cited reference does not mention an xmlns attribute at all.

Note though, that although it is not valid HTML4 or HTML5, it will do no harm.

Another Option

"Using the Facebook JavaScript Client Library, you can render XFBML inline on a Facebook Connect site or iframe canvas page, without using XFBML tags."

http://wiki.developers.facebook.com/index.php/Using_HTML_to_Imitate_XFBML

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!