在 Internet Explorer 8 上,在有评论计数标记的页面上,<fb:comments-count href="<%= item_url(@item) %>"></fb:comments-count>
Internet Explorer 8 会出现错误。
无法设置 innerHTML:未知的运行时错误。
行:40,字符:327
http://connect.facebook.net/en_US/all.js
所有其他 Facebook 插件(如按钮、评论框)都按预期工作。
在 Internet Explorer 8 上,在有评论计数标记的页面上,<fb:comments-count href="<%= item_url(@item) %>"></fb:comments-count>
Internet Explorer 8 会出现错误。
无法设置 innerHTML:未知的运行时错误。
行:40,字符:327
http://connect.facebook.net/en_US/all.js
所有其他 Facebook 插件(如按钮、评论框)都按预期工作。
我发现 facebook 命名空间声明必须在头部级别。
我从
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object#">
至
<html xmlns:fb="http://ogp.me/ns/fb#">
<head prefix="og: http://ogp.me/ns# object: http://ogp.me/ns/object#">
并且错误消失了。
我在关注Open Graph 命名空间声明:HTML with XMLNS or head prefix? 但是 ie8 的 use-prefix-all-the-way 显然有一些问题。
更新
我意识到我错误地使用了<fb:comments-count>
标签也是错误的,而我<div class="fb-comments-count">
在所有其他地方都使用了 HTML5 标签。
如果我保留命名空间声明,但使用正确的 HTML5 注释标签,那么错误也会消失。