gpt4 book ai didi

facebook - 方法 FB.ui 在 Firefox 和 Internet Explorer 上调用时永远加载

转载 作者:行者123 更新时间:2023-11-30 05:22:32 24 4
gpt4 key购买 nike

我在 3 或 4 天前运行的脚本中遇到问题。

我正在使用这个(简化版)代码向用户发送应用程序请求,它一直工作到几天前,现在似乎 facebook 中的某些内容发生了变化并且窗口(在 iframe 中自动打开)在 Firefox 和 Internet Explorer 中永久加载。它继续正常工作。

我知道我可以强制显示参数:'popup',但是在其他一些 javascript 行之后发送请求意味着 firefox 会阻止弹出窗口打开,所以它对我没用。

function Test()
{
FB.ui({method: 'apprequests', message: 'My Great Request' }, CallbackFunction);
}


function CallbackFunction(response)
{
alert(JSON.stringify(response));
}

页面没有样式,很干净,这里是完整代码:http://pastebin.com/QqbRceJ2

事情是这样的:http://i59.tinypic.com/10hq6w5.png

感谢任何帮助,我从星期一开始就坚持这个...

最佳答案

正如 Slav 所说,它是一个 confirmed Facebook SDK bug这与 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 .

虽然您没有传递 display=iframe 参数,但 FB.ui 的默认行为是模态 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.

尝试将您的 function Test() 更改为:

function Test(){
FB.ui({display: 'popup', method: 'apprequests', message: 'My Great Request' }, CallbackFunction);
}

关于facebook - 方法 FB.ui 在 Firefox 和 Internet Explorer 上调用时永远加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22388607/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com