FB.ui apprequest 对话框出现问题

发布于 2024-12-07 02:33:02 字数 495 浏览 2 评论 0原文

我正在尝试从 Iframe 应用程序发送应用程序邀请。我像这样打开对话框。

function sendRequestToOneRecipient(user_id) {
        FB.ui({method: 'apprequests',
          message: 'message',
          to: user_id,
          display: 'popup'
        }, requestCallback(user_id));
      }

当对话框打开时,我收到大量“不安全的 JavaScript 尝试从具有 URL 的框架访问具有 URL 的框架”错误消息。发送和取消按钮只会使对话框变为空白,但不会关闭并且不起作用。

我不知道它是否相关,但是当在 Chrome 中加载 JS SDK 时,我得到“无法读取未定义的属性'cb'”,并且 Firefox 说“b 未定义”。我不再有任何对旧的 FeatureLoader.js 的引用。

I am trying to send application invites from an Iframe application. I open the dialog like this.

function sendRequestToOneRecipient(user_id) {
        FB.ui({method: 'apprequests',
          message: 'message',
          to: user_id,
          display: 'popup'
        }, requestCallback(user_id));
      }

When the dialog opens I get a ton of "Unsafe JavaScript attempt to access frame with URL from frame with URL" error messages. The send and cancel buttons just make the dialog go blank, but not close and it doesn't work.

I don't know if it's related or not, but when loading the JS SDK in Chrome I get "Cannot read property 'cb' of undefined" and Firefox says "b is undefined". I do not have any references to the old FeatureLoader.js anymore.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

睡美人的小仙女 2024-12-14 02:33:02

这就是我用来发送 apprequest 的代码,并且在 Chrome 或 Firefox 上从未遇到过问题...:

他们最近在这里发布了更多示例:http://developers.facebook.com/docs/reference/dialogs/requests/

希望有帮助

function send_apprequest(){
var post_options = {
    method: 'apprequests',
    display: 'iframe', 
    message: "My  message",
    data: "Any data your want to pass",
    title: "My Title",
    ref: "Not required but useful for Insights"
};

FB.ui(post_options,function(response) {
                if (response && response.request_ids) {
                        alert('\o/');

                       }
                }            
         ); 
}

Thats the code I use to send apprequest, and never had problem either with Chrome or Firefox ... :s

They post recently more examples recently here : http://developers.facebook.com/docs/reference/dialogs/requests/

Hope that helps

function send_apprequest(){
var post_options = {
    method: 'apprequests',
    display: 'iframe', 
    message: "My  message",
    data: "Any data your want to pass",
    title: "My Title",
    ref: "Not required but useful for Insights"
};

FB.ui(post_options,function(response) {
                if (response && response.request_ids) {
                        alert('\o/');

                       }
                }            
         ); 
}
灰色世界里的红玫瑰 2024-12-14 02:33:02

我发现了问题。包含的 Javascript 文件与 Facebook 的 Javascript 冲突。我不太确定究竟是什么发生了冲突,但它是 2005 年的 JSON 库。值得庆幸的是,它没有被使用,所以我只是将其删除。这是文件的版权信息。

// VC-JSON
/*

PROJECT:    JDM (Java Dynamic Machine)
PROGRAMMER: PRIVATE LICENSE
FILE:       vc-json/vc-json.js
PURPOSE:    GO! SERIALIZER & DE-SERIALIZER...

Includes functions for:

-- JSON/GO! Serialization
-- JSON/GO! DE-Serialization
-- JSON/GO! Parsing

*/

var JSON = {


version : "0.000a",
org: 'http://www.JSON.org',
copyright: '(c)2005 JSON.org',
license: 'http://www.crockford.com/JSON/license.html'

I found the problem. There was an included Javascript file that was conflicting with Facebook's Javascript. I'm not really sure exactly what was conflicting, but it was a JSON library from 2005. Thankfully, it's not being used so I just removed it. This is the copyright information on the file.

// VC-JSON
/*

PROJECT:    JDM (Java Dynamic Machine)
PROGRAMMER: PRIVATE LICENSE
FILE:       vc-json/vc-json.js
PURPOSE:    GO! SERIALIZER & DE-SERIALIZER...

Includes functions for:

-- JSON/GO! Serialization
-- JSON/GO! DE-Serialization
-- JSON/GO! Parsing

*/

var JSON = {


version : "0.000a",
org: 'http://www.JSON.org',
copyright: '(c)2005 JSON.org',
license: 'http://www.crockford.com/JSON/license.html'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文