本文介绍了方法FB.ui在Firefox和Internet Explorer上调用时永远加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用这个(简化版本)代码发送应用程序请求到一个用户,直到几天前才开始工作,现在看来Facebook中的某些东西已经改变,窗口(在iframe中自动打开)永远在Firefox和Internet Explorer中加载。我知道我可以强制参数显示:弹出,但是在其他一些JavaScript行发送请求之后,这意味着firefox阻止了弹出窗口,所以对我来说是无用的。 function Test() { FB.ui ({method:'apprequests',message:'My Great Request'},CallbackFunction); } 函数CallbackFunction(响应) { alert(JSON.stringify(response)); } 该页面没有风格,它很干净,这里是完整的代码: http://pastebin.com/QqbRceJ2 这是发生什么: http://i59.tinypic.com/10hq6w5.png 任何帮助都被解除,我星期一被困在这个... 解决方案由于斯拉夫说这是一个确认的Facebook SDK错误与iframe有关: 当您向feed对话框提供 display:iframe参数时,会出现此问题。如果这被删除,对话框应该被正确显示为临时修复,而这是调查。 虽然您没有传递 display = iframe 参数,但 FB.ui 的默认行为是一种模式iframe : 显示参数确定对话框的呈现方式。如果您使用URL 重定向对话框实现,那么这将是一个完整的页面显示,显示在Facebook.com。此显示类型称为页面。如果您的正在使用我们的一个iOS或Android SDK来调用该对话框,则自动指定,并为该设备的选择适当的显示类型。如果您使用的是JavaScript SDK,则在Facebook.com上的游戏中使用时,默认为a模式的iframe类型,并且每个人都可以使用弹出窗口其他。如果需要,还可以使用 JavaScript SDK强制弹出或页面类型。移动网络应用程序将始终默认为触摸显示类型。 尝试更改您的功能测试() to this: function Test(){ FB.ui({显示:'popup',方法:'apprequests',message:'My Great Request'},CallbackFunction); } I have problem in a script that was working until 3 or 4 days ago.I'm using this (simplified version) code to send an app request to a user and it was working until few days ago, now it seems that something in facebook has changed and the window (wich is opened in iframe automatically) loads forever in Firefox and Internet Explorer. It continues to work normaly.I Know that I can force the parameter display: 'popup', but sending the request after some other javascript lines it means that firefox blocks the popup opening and so it is useless for me.function Test(){FB.ui({method: 'apprequests', message: 'My Great Request' }, CallbackFunction);}function CallbackFunction(response){alert(JSON.stringify(response));}The page has no style and it's clean, here the full code: http://pastebin.com/QqbRceJ2This is what it happens: http://i59.tinypic.com/10hq6w5.pngAny help is apreciated, I'm stuck on this since monday... 解决方案 As Slav said it's a confirmed Facebook SDK bug that's related to iframe: It appears this issue is occurring when you provide the display:"iframe" parameter to the feed dialog. If that is removed the dialog should be displayed correctly as a temp fix while this is investigated .Although you're not passing the display=iframe parameter, the default behavior of the FB.ui is a modal iframe: The display parameter: determines how the dialog is rendered. If you are using the URL redirect dialog implementation, then this will be a full page display, shown within Facebook.com. This display type is called page. If you are using one of our iOS or Android SDKs to invoke the dialog, this is automatically specified and chooses an appropriate display type for the device. If you are using the JavaScript SDK, this will default to a modal iframe type for people logged into your app or async when using within a game on Facebook.com, and a popup window for everyone else. You can also force the popup or page types when using the JavaScript SDK, if necessary. Mobile web apps will always default to the touch display type.Try changing your function Test() to this:function Test(){ FB.ui({display: 'popup', method: 'apprequests', message: 'My Great Request' }, CallbackFunction);} 这篇关于方法FB.ui在Firefox和Internet Explorer上调用时永远加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-27 19:22