Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript SDK在Facebook画布应用程序IE7/8中不工作_Javascript_Internet Explorer_Facebook Javascript Sdk - Fatal编程技术网

Javascript SDK在Facebook画布应用程序IE7/8中不工作

Javascript SDK在Facebook画布应用程序IE7/8中不工作,javascript,internet-explorer,facebook-javascript-sdk,Javascript,Internet Explorer,Facebook Javascript Sdk,我正在开发一个canvas应用程序,它可以在除IE 7/8之外的所有浏览器中正常工作,如果用户尚未登录Facebook,我无法让应用程序自动重定向到Facebook登录屏幕 我怀疑IE没有通过getLoginStatus方法获取用户的状态,因此无法触发javascript重定向,因此删除应用程序功能也无法工作 我已经通过一个在线JS lint工具运行了代码,整理了一些东西,然后再试了一次,但没有成功 如果我在facebook之外尝试,例如,JSSDK可以完美地工作并重定向到facebook登录页

我正在开发一个canvas应用程序,它可以在除IE 7/8之外的所有浏览器中正常工作,如果用户尚未登录Facebook,我无法让应用程序自动重定向到Facebook登录屏幕

我怀疑IE没有通过getLoginStatus方法获取用户的状态,因此无法触发javascript重定向,因此删除应用程序功能也无法工作

我已经通过一个在线JS lint工具运行了代码,整理了一些东西,然后再试了一次,但没有成功

如果我在facebook之外尝试,例如,JSSDK可以完美地工作并重定向到facebook登录页面,但在facebook iframe中不会这样做

我注意到,在Facebook iframe中,系统无法获得浏览器模式,并且不确定这是否会产生影响

这是我的完整代码

$(document).ready( function() {
//Facebook JS SDK
window.fbAsyncInit = function () {
    FB.init({
        appId: 'xxxxxxxxxxxxxxxxx',
        channelUrl: '//www.mydomain.co.uk/facebook-notes/channel.html',
        // Channel File
        cookie: true,
        xfbml: true,
        oauth: true,
        status: true
    });
    FB.getLoginStatus(function (response) {
        if (response.status === 'connected') {
            //alert('hello');
            $('a#remove-app').click(function () {
                var request = response.authResponse.accessToken;
                $("#dialog:ui-dialog").dialog("destroy");
                $("#dialog-confirm").dialog({
                    height: 140,
                    modal: true,
                    position: [236, 101],
                    buttons: {
                        "Yes": function () {
                            if (request) {
                                $.ajax({
                                    url: 'https://graph.facebook.com/me/permissions',
                                    type: 'GET',
                                    data: 'method=delete&access_token=' + request,
                                    dataType: 'jsonp',
                                    success: function (response) {
                                        top.location.href = 'http://facebook.com';
                                    }
                                });
                            }
                        },
                        Cancel: function () {
                            $(this).dialog("close");
                        }
                    }
                });
                return false;
            });
        } else {
            //alert('user not logged in');
            var oauth_url = 'https://www.facebook.com/dialog/oauth/';
            oauth_url += '?client_id=xxxxxxxxxxxxxxx';
            oauth_url += '&redirect_uri=' + encodeURIComponent('https://apps.facebook.com/app_name/');
            oauth_url += '&scope=email';
            window.top.location = oauth_url;
        }
    },
        true);
    $('a#invite-a-friend').click(function () {
        sendRequestViaMultiFriendSelector();
    });
    // Multi friend selector for Facebook
    function sendRequestViaMultiFriendSelector() {
        FB.ui({
            method: 'apprequests',
            message: 'Come and join the app on Facebook'
        });
    }
    function requestCallback(response) {
        alert (response);
    }
};
// Load the SDK Asynchronously
(function (d) {
    var js,
        id = 'facebook-jssdk',
        ref = d.getElementsByTagName('script')[0];
    if (d.getElementById(id)) {
        return;
    }
    js = d.createElement('script');
    js.id = id;
    js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    ref.parentNode.insertBefore(js, ref);
}(document));
});

我将非常感谢任何帮助

很可能是旧的第三方Cookie问题的另一种表现。搜索第三方Cookie/P3P策略,以找到能够使其工作的解决方案。

我已尝试按照建议实施P3P策略,但仍然没有成功。后来我在Windows7上的IE8上试用过,效果很好,似乎是在XP上本地化为IE8,有人知道为什么吗?