Facebook JS SDK不能在Safari上工作 [英] Facebook JS SDK Not Working On Safari

查看:96
本文介绍了Facebook JS SDK不能在Safari上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了我在我网站上使用的Facebook SDK。它在每个浏览器上都可以很好的减去Safari,偶尔也不会加载Facebook Connect按钮。



查看JS错误我收到以下消息。他们来自作为FB的JS库的all.js。任何人有任何想法?

 fb-rootdiv尚未创建。 (all.js Line 3)
TypeError:'undefined'不是一个对象(评估'e.root.appendChild')(all.js第6行)


解决方案

使用Facebook的all.js时,您需要确保您有 div ,其ID设置为 fb-root 通常低于正文标签。确保你有:

  ...... 
< body>
< div id =fb-root>< / div>
< script>
// facebook js code here
< / script>

您发布的错误消息清楚地表示没有找到这样的div,这意味着你应该您的页面如上所示。


I've got an implementation of the Facebook SDK that I'm using in my site. It works great on every browser minus Safari where occasionally the Facebook Connect button won't load.

Looking at the JS errors I'm getting the following messages. They're coming from all.js which is FB's JS library. Anyone got any ideas?

The "fb-root" div has not been created. (all.js Line 3)
TypeError: 'undefined' is not an object (evaluating 'e.root.appendChild') (all.js Line 6)

解决方案

When working with Facebook's all.js, you need to make sure that you have div with id set to fb-root typically below the body tag. Make sure you have:

......
<body>
<div id="fb-root"></div>
<script>
// facebook js code here
</script>

The error message you have posted clearly says it does not find such div which means you should have it on your page like shown above.

这篇关于Facebook JS SDK不能在Safari上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆