Ajax 帖子被火狐中止(在 Chrome 或 IE 中看不到) [英] Ajax post being aborted by firefox (not seen in Chrome or IE)

查看:15
本文介绍了Ajax 帖子被火狐中止(在 Chrome 或 IE 中看不到)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 firefox 时,我的 ajax post 请求在 firebug 中被报告为中止.ajax 帖子在 IE 和 Chrome 中运行良好.这不是跨域请求.我尝试使用 fiddler 查看问题,当 fiddler 捕获网络流量(选项设置为解密 https)时,该帖子有效.无法在我的本地开发环境中创建发布问题,因为所有 Firefox 尝试都成功发布了我通过 ajax 发送的数据.知道为什么在 fiddler 运行时帖子有效吗?它可能让我知道如何让它工作.

When using firefox, an ajax post request i have is being reported as aborted in firebug. The ajax post works fine in IE and Chrome. It is not a cross domain request. I tried looking at the issue using fiddler, and when fiddler is capturing web traffic (with options set to decrypt https) the post works. The post issue cannot be created in my local development environment, as all Firefox attempts successfully post the data I'm sending via ajax. Any idea why the post works while fiddler is running? It might give me some idea of how to get it working.

$.ajax({
            type: 'POST',
            url: '/Save',
            data: JSON.stringify(dataset),
            datatype: "html",
            contentType: "application/json",
            success: function (data, textStatus, jqXHR) {
                //alert("success");
            },
            error: function (jqXHR, textStatus, errorThrown) {
                //alert("error");
            }
        });

此外,这个ajax请求被许多方法调用,只有当最大的数据集被发送时才会失败.

Also, this ajax request is called by a number of methods, and only when the largest of the datasets is sent does it fail.

推荐答案

Try only

async: false

在 ajax 选项中,我遇到了同样的问题.

in ajax option, I had the same problem.

这篇关于Ajax 帖子被火狐中止(在 Chrome 或 IE 中看不到)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆