Facebook Web应用程序开发错误

Facebook Web App development error

本文关键字:错误 应用程序开发 Web Facebook      更新时间:2023-09-26

我在chrome 的调试控制台上不断收到以下错误

[blocked] The page at https://myURL/canvas ran insecure content from http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css.
[blocked] The page at https://URL/canvas ran insecure content from http://connect.facebook.net/en_US/all.js.
[blocked] The page at https://URL/canvas ran insecure content from http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js.

这些是附在头上的js脚本

这是一个脸书应用程序,它向我自己的服务器发出GET请求,这是有效的,只是停止了工作,我的代码没有任何更改!我不确定Facebook是否屏蔽了我的请求。

当主页(在您的情况下是您的Facebook应用程序)通过HTTPS加载时,通过HTTP在其他域上加载脚本和其他外部资源(如图像)时会发生这些错误。

查看应用程序的代码,在调用外部脚本时使用与协议相关的URL。例如,代替这个:

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">

这样做:

<script src="//connect.facebook.net/en_US/all.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">

编辑:请注意,如果在样式表上使用与协议相关的URL,IE7和IE8将下载两次:http://paulirish.com/2010/the-protocol-relative-url/