【发布时间】:2012-01-10 10:19:13
【问题描述】:
尽管我严格遵守 Facebook 文档,但 HTML 5 验证器在我的代码上还是失败了。有各种各样的问题,但让我们从一个例子开始。
我正在关注Facebook "Getting Started" documentation 并使用 th5is 代码:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
唯一的区别是我在这之前添加了<!DOCTYPE html> 用于 HTML5。通过W3C HTML5 validator 运行它时出现此错误:
Attribute xmlns:og not allowed here
我能想到的唯一错误是:
- Facebook 的文档有误
- 我应该在
<!DOCTYPE html>声明中添加某种命名空间。
但是,无论哪种情况,我都不知道解决方法是什么。希望得到一些帮助!
【问题讨论】:
-
更好的重复问题,有可用的答案:stackoverflow.com/questions/6501189/…
标签: facebook html facebook-opengraph