【问题标题】:ajax call returns null in my facebook iframeajax 调用在我的 facebook iframe 中返回 null
【发布时间】:2011-02-06 05:19:59
【问题描述】:

我正在使用 jquery 从 iframe 中的我的 facebook 应用程序向我的服务器发送一个 ajax 请求。 当网络应用程序独立运行并在 facebook 平台之外运行时,ajax 请求工作正常,但在 facebook 中,我从 ajax 请求得到的结果是空白的!!! 这是我使用的代码:

$.ajax({
    url: 'http://mydomain.com/search',
    data: params,
    cache: false,
    dataType: 'json',
    success: function(posts) {
                // post is null !!!!!
             }
    error: function(json) {
                alert('error');
            }            
    });

如果有人可以帮助我,我将不胜感激。

谢谢。

【问题讨论】:

    标签: jquery ajax facebook iframe


    【解决方案1】:

    好的,我自己解决了。 这是一个跨域问题。

    【讨论】:

    • 你是怎么解决的?这样未来的用户可以看到相同问题的答案
    猜你喜欢
    • 1970-01-01
    • 2018-11-13
    • 1970-01-01
    • 1970-01-01
    • 2021-11-11
    • 1970-01-01
    • 1970-01-01
    • 2023-03-29
    • 1970-01-01
    相关资源
    最近更新 更多