Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/299.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
Php 403禁止错误,仅在Firefox中调用Ajax_Php_Jquery - Fatal编程技术网

Php 403禁止错误,仅在Firefox中调用Ajax

Php 403禁止错误,仅在Firefox中调用Ajax,php,jquery,Php,Jquery,下面是我的代码,它在Chrome上运行良好,但是Firefox在我的代码中显示了403禁止在save2.php上执行AJAX请求的错误。还有,为什么要花这么多时间来加载 场景:表单提交到preview.php,其中返回一个div作为响应。返回的div将转换为图像并发送到save2.php,后者将图像保存到服务器 $('.sharer').click(function(e){ $(this).html("<img src='img/spinner.gif' style='p

下面是我的代码,它在Chrome上运行良好,但是Firefox在我的代码中显示了403禁止在save2.php上执行AJAX请求的错误。还有,为什么要花这么多时间来加载

场景:表单提交到preview.php,其中返回一个div作为响应。返回的div将转换为图像并发送到save2.php,后者将图像保存到服务器

$('.sharer').click(function(e){

        $(this).html("<img src='img/spinner.gif' style='pointer-events: none; cursor: default;'/>");


        e.preventDefault(); 
        $.ajax({
          type: "POST",
          cache: false,
          url: this.href, // our preview file (preview.php)
          data: $("#myForm").serializeArray(), // all the fields in your form (use the form's ID)
          success: function (response) {

          $(".the-return").html(response);

             elem = $('.the-return');
             html2canvas(elem, {
             onrendered: function(canvas) {
             var img = canvas.toDataURL("image/png");
             var output = encodeURIComponent(img);
             var Parameters = "image=" + output;
             var me = this;
             }
             }); //HTML2CANVAS

             $.ajax({
                type: "POST",
                url: "save2.php", // Only Firefox showing 403 forbidden
                data: Parameters,
                success: function (datas) {
                $(".sharer").html("<img src='img/share.png'/>");
                    //$(".imgs").html(datas);

                     FB.ui(
                       {
                         method: 'feed',
                         name: 'XXXX',
                         link: 'XXXX',
                         picture: 'XXXX/'+datas,
                         media: [{'type': 'image', width: '586', height: '586'}],
                         caption: 'XXXX',


                         //type: 'video',
                         description: 'XXXX',
                         message: 'Facebook Dialogs are easy!'
                       },
                       function(response) {
                         if (response && response.post_id) {

                         } else {

                         }
                       }
                     ); //Fb Sgare
                 }

                });





          } // success
          }); // ajax



}); // on click

这个链接显示了403禁止错误的原因,只是给它一个tryno运气,数据是发布和显示的,但不是作为响应返回,使用async:false为ajaxNothing,从firebug如果我打开save2.php到new tab,它显示禁止,但直接在new tab上输入url是打开页面尝试更改文件夹权限,chmod-R 777/path/to/save2