我最近开始在 Facebook 应用程序上工作,但我迷失了方向,并试图得到任何直接的答案。用谷歌搜索答案似乎不太适合 facebook,因为事情变化太快,博客很少更新它以反映新的 API。
我知道 Facebook 会弃用 FBML,对此我感到非常高兴。所以我的问题是,DOCTYPE facebook 会给你放在你的网站上,被弃用吗?
这样做有什么用?
Assuming you are talking about this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
(specifically the xmlns:fb="http://www.facebook.com/2008/fbml"
). They are not deprecating that. You should continue to add xmlns:fb="http://www.facebook.com/2008/fbml"
in your <html>
tag. However, for modernity you should be using the HTML5 doctype, so your doctype and HTML tag should look like this:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
What the xmlns:fb
part does is specifies the XML namespace for tags within the page which begin with the fb:
prefix (such as <fb:name/>
).