我没有在我的申请中使用任何 Flash。导致问题的代码是您在最后可以找到的最简单的代码。
我将我的应用程序配置为在 IFrame 中工作,正如它在 facebook 开发者网站上提到的那样。
问题是,当我添加 init 选项时,页面不会停止对 IE8 中的服务器进行 ajax 调用(无限循环),如果我使用它一段时间并在我完成后上下移动单击按钮提交表单我看到了这些类型的错误:
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2047: Security sandbox violation: LocalConnection.send: ak.fbcdn.net cannot access http://static.ak.fbcdn.net/rsrc.php/v1/yF/r/Y7YCBKX-HZn.swf.
或
Error #2044: Unhandled StatusEvent:. level=error, code=
同样,我没有在我的 Facebook 应用程序中使用任何 Flash/Flex/SWF,我使用的是最简单的代码,只包含 JS,没有任何更改。
<!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<!-- stylesheets for the UI -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
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
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
<form>
<button type="submit"> WOW</button>
</form>
</body>
</html>
最佳答案
在 Facebook Developer 应用程序中检查您的应用程序设置:如果您的 Site Domain 字段设置不正确,我注意到类似的问题。该页面只是一遍又一遍地不断刷新。
我不知道该放什么值让它停止这样做,所以我简单地清除了那个字段,问题就消失了。
关于javascript - IFrame 中的 FB.init 导致 IE8 无限循环,并在一段时间后出现 Flash 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5995748/