javascript Facebook 连接在 Internet Explorer 8 中登录时显示空白弹出窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5778100/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Facebook connect showing blank popup on login in Internet explorer 8
提问by Shameer
I am integrating facebook login to my application and it is working fine in browsers except IE. It opens the login window, after login redirecting to http://static.ak.fbcdn.net/connect/xd_proxy.php, and got stuck there displaying a blank page in the popup. In other browsers it will close the popup and redirect to my site. My application url is like http://dev.mysite.com/app/
. so I have given the domain name dev.mysite.com
in facebook application settings. I am using facebook javascript sdk and my site is in PHP. Some one please help me to figure out the actual problem.
我正在将 facebook 登录集成到我的应用程序中,它在除 IE 之外的浏览器中运行良好。它打开登录窗口,登录重定向到http://static.ak.fbcdn.net/connect/xd_proxy.php 后,卡在那里,在弹出窗口中显示一个空白页面。在其他浏览器中,它会关闭弹出窗口并重定向到我的网站。我的应用程序 url 就像http://dev.mysite.com/app/
. 所以我dev.mysite.com
在 facebook 应用程序设置中给出了域名。我正在使用 facebook javascript sdk,我的网站使用 PHP。有人请帮我找出实际问题。
Thanks in advance
提前致谢
采纳答案by Shameer
I have solved the issue by giving channelUrl
parameter in FB.init . Now its working fine. Given absolute url to channel receiver. Content of that file will be a single line <script src="http://connect.facebook.net/en_US/all.js"></script>
. Thanks to all :)
`
我已经通过channelUrl
在 FB.init 中提供参数解决了这个问题。现在它工作正常。给定绝对 url 到频道接收器。该文件的内容将是一行<script src="http://connect.facebook.net/en_US/all.js"></script>
。谢谢大家:)`
回答by john 4d5
If someone is still having problems, there are two things that usually cause fb login problems (it stays open, blank, no response..) in IE:
如果有人仍然遇到问题,通常有两件事会导致 IE 中的 fb 登录问题(它保持打开、空白、无响应..):
- Missing
channelUrl
parameter inFB.init
. - Protected mode: IE -> Internet Options -> Security tab -> Local intranet ->(check) Enable protected mode
- 中缺少
channelUrl
参数FB.init
。 - 保护模式:IE -> Internet 选项 -> 安全选项卡 -> 本地内网 ->(勾选)启用保护模式
回答by borisdiakur
The custom channel solution provided by @Shameer solved the problem for me. See also the documentation for the Custom Channel URL here: http://developers.facebook.com/docs/reference/javascript/FB.init/
@Shameer 提供的自定义渠道解决方案为我解决了这个问题。另请参阅此处自定义频道 URL 的文档:http: //developers.facebook.com/docs/reference/javascript/FB.init/
回答by Sean Kinsey
See this bug report : IE8, getLoginStatus never completes when flash XD is used- it sounds like it might be what you are experiencing.
请参阅此错误报告:使用 Flash XD 时,IE8、getLoginStatus 永远不会完成- 听起来这可能就是您遇到的情况。
In that case, make sure that your fb-root
div is not being set to visibility:hidden
or display:none
as this will cause the XD Flash not to render.
在这种情况下,请确保您的fb-root
div 未设置为 ,visibility:hidden
否则display:none
会导致 XD Flash 无法呈现。
回答by JustCoding
Sometimes this happens because of cookies , try to clear cookies.And its not just the problem in IE , its also problem in other browsers.If you test your app again you'll face it. The best option for it is to use php api , it will take you to the facebook page user will enter credentials and it will send back you to your site again , with string embedded in your url.This is best way without any harm.And easy to implement.
有时发生这种情况是因为 cookie,请尝试清除 cookie。这不仅是 IE 的问题,其他浏览器也有问题。如果您再次测试您的应用程序,您将面临它。最好的选择是使用 php api,它会带你到 facebook 页面,用户将输入凭据,它会再次将你发送回你的网站,字符串嵌入你的 url。这是最好的方法,没有任何伤害。而且易于实施。
回答by OnethingSimple
If you use an AdBlockersuch as Privacy Badger(which I use and love), it may by default block some external urls like Facebook when opened in a popup window, resulting in a blank screen.
如果您使用诸如Privacy Badger(我使用并喜欢)之类的AdBlocker,则默认情况下它可能会在弹出窗口中打开时阻止某些外部 url,例如 Facebook,从而导致空白屏幕。
Simply disable Privacy Badger(or other extension) for that page, or go into the settings and make sure not to block the following urls:
只需禁用该页面的Privacy Badger(或其他扩展程序),或进入设置并确保不要阻止以下网址:
- www.facebook.com
- staticxx.facebook.com
- graph.facebook.com
- s-static.ak.facebook.com
- www.facebook.com
- staticxx.facebook.com
- 图.facebook.com
- s-static.ak.facebook.com
That should do it (hopefully)!
应该这样做(希望如此)!
Extra tipbut beside the point; I found that it's generally ok to not allow cookiesfrom those URLs, so long as your not blocking the request then the Facebook popup should still work. It's probably good to try out your app using different setups.
额外的提示,但离题了;我发现不允许来自这些 URL 的cookie通常是可以的,只要您不阻止请求,那么 Facebook 弹出窗口应该仍然有效。使用不同的设置来试用您的应用程序可能很好。
回答by Thomas Aldrin
If someone is still having problem with this, the easiest fix is to use the latest API from http://code.google.com/p/facebook-actionscript-api/and publish the .swf for Flash Player 10 (this is the most important part).
如果有人对此仍有问题,最简单的解决方法是使用来自http://code.google.com/p/facebook-actionscript-api/的最新 API并发布 Flash Player 10 的 .swf(这是最重要的部分)。