Facebook Javascript SDK问题:“FB未定义” [英] Facebook Javascript SDK Problem: "FB is not defined"

查看:171
本文介绍了Facebook Javascript SDK问题:“FB未定义”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Facebook文档此处复制的以下代码不适用于我在Chrome中。

The following code, copied from the Facebook documentation here, is not working for me in Chrome.

<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
  FB.init({
  appId  : 'YOUR APP ID',
  status : true, // check login status
  cookie : true, // enable cookies to allow the server to access the session
  xfbml  : true  // parse XFBML
});
</script>

在Javascript控制台中,我得到:

In the Javascript console I get:

Uncaught ReferenceError: FB is not defined

我不是在Firefox或Safari中,只要使用Chrome就可能有任何问题。

I'm not having any problems with the SDK in Firefox or Safari, just Chrome.

推荐答案

我看到一个案例,Chrome已经安装了WidgetBlock,阻止Facebook脚本。结果就是这个错误消息。确保您禁用可能会干扰的任何扩展名。

I saw a case where Chrome had installed WidgetBlock which was blocking the Facebook script. The result was exactly this error message. Make sure you disable any extensions that may interfere.

这篇关于Facebook Javascript SDK问题:“FB未定义”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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