Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.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
Ajax 仅在IE9上通过facebook api发布照片时出错_Ajax_Facebook_Internet Explorer_Facebook Graph Api_Image Uploading - Fatal编程技术网

Ajax 仅在IE9上通过facebook api发布照片时出错

Ajax 仅在IE9上通过facebook api发布照片时出错,ajax,facebook,internet-explorer,facebook-graph-api,image-uploading,Ajax,Facebook,Internet Explorer,Facebook Graph Api,Image Uploading,这是一个javascript函数,用于通过facebook api将照片上传到facebook。 它可以在任何地方工作,除了在InternetExplorer9中 var sTagsPostcard = '[{tag_uid:' + sIdProfile + ',x:' + aPositonsTags[sIdLayoutPostcard][0] + ',y:' + aPositonsTags[sIdLayoutPostcard][1] + '},' + '{tag_uid:' +

这是一个javascript函数,用于通过facebook api将照片上传到facebook。 它可以在任何地方工作,除了在InternetExplorer9中

var sTagsPostcard =
    '[{tag_uid:' + sIdProfile + ',x:' + aPositonsTags[sIdLayoutPostcard][0] + ',y:' + aPositonsTags[sIdLayoutPostcard][1] + '},' +
    '{tag_uid:' + sIdFriend + ',x:' + aPositonsTags[sIdLayoutPostcard][2] + ',y:' + aPositonsTags[sIdLayoutPostcard][3] + '}]';

var the_url = $('input[name="hdnDomain"]').val() + 'media/postcards/' + sPathPostcard

$.ajax({
    type: "POST",
    url: "https://graph.facebook.com/" + sIdProfile + "/photos",
    data: {
        message: 'MESSAGE',
        url: the_url,
        format: "json",
        access_token: sToken,
        tags: sTagsPostcard
    },
    success: function(data){
        if($('html').hasClass('touch'))
            $('form[name="frmCustomLayout"]').submit();
        else
            window.parent.location.href = 'https://apps.facebook.com/[APPLICATION_NAME]/?st=' + N_STEP_THANKS;
    },
    error:function(a,b,c){
        if($('html').hasClass('touch')){
            $('input[name="st"]').val(N_STEP_RESULT);
            $('form[name="frmCustomLayout"]').submit();
        }
        else
            window.parent.location.href = 'https://apps.facebook.com/[APPLICATION_NAME]/?st=' + N_STEP_RESULT;
    }
});
执行将进入error()而不是success()函数,这些是参数a、b、c:

  • 对象错误(或类似的)
  • b:错误
  • c:禁止运输

对IE9有什么想法吗??提前感谢调用graph.facebook api的javascript ajax,它在IE9/IE8这样的浏览器中似乎不起作用

解决这个问题的诀窍是对本地脚本进行ajax调用,并通过该调用使用FacebookAPI完成相同的帖子。
通过这种方式,在所有浏览器中,帖子都能正常工作。

你好,阿克塞尔,你还记得你是如何做到这一点的吗@ᴊᴀᴠ当时我使用PHP库调用Facebook API和javscript。