Facebook graph api 为什么把这个添加到doctype会弄乱我的meta标签?

Facebook graph api 为什么把这个添加到doctype会弄乱我的meta标签?,facebook-graph-api,facebook,facebook-like,Facebook Graph Api,Facebook,Facebook Like,当我通过facebook lint运行我的网站时(http://developers.facebook.com/tools/debug)…一切都很好 这是我以前的doctype: <!DOCTYPE html> 然后,我在doctype中添加了“xmlns” <!DOCTYPE html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 我再次

当我通过facebook lint运行我的网站时(http://developers.facebook.com/tools/debug)…一切都很好

这是我以前的doctype:

<!DOCTYPE html>

然后,我在doctype中添加了“xmlns”

<!DOCTYPE html  xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">


我再次通过Facebook Lint运行了它……Facebook再也不能扫描我的任何元标记了。为什么?它说所有属性都丢失了。

xmlns属性放在标记上,而不是doctype。

将名称空间添加到html标记而不是doctype

    <!DOCTYPE HTML> 
        <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#">
<head>
<title></title>
</head>
</body>
</body>
</html>


有关doctype和命名空间用法的详细信息,请参见此处