阿贾克斯岗位被中止的Firefox(没有看到在Chrome或IE浏览器)岗位、浏览器、阿贾克斯、Firefox

由网友(樱花祭.)分享简介:当使用火狐,一个ajax post请求我已经被报告为中止的萤火虫。阿贾克斯后工作正常,在IE浏览器和Chrome。这不是一个跨域请求。我试图寻找这个问题使用小提琴手,当小提琴手正在捕获网络流量(带设置解密HTTPS选项)后的作品。该职位问题不能在我的本地开发环境中创建的,因为所有的Firefox成功尝试后,我通过AJA...

当使用火狐,一个ajax post请求我已经被报告为中止的萤火虫。阿贾克斯后工作正常,在IE浏览器和Chrome。这不是一个跨域请求。我试图寻找这个问题使用小提琴手,当小提琴手正在捕获网络流量(带设置解密HTTPS选项)后的作品。该职位问题不能在我的本地开发环境中创建的,因为所有的Firefox成功尝试后,我通过AJAX发送数据。任何想法,为什么而小提琴手正在运行后的作品?这可能给我如何得到它的工作的一些想法。

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.

推荐答案

如果您发送的事件处理程序这个AJAX请求(例如:点击提交按钮),请务必prevent浏览器的默认行为(提交的形式),直到你将有2个HTTP请求发射,第一个被中止。

If you send this AJAX request from an event handler (example : click of a submit button), be sure to prevent the browser's default behavior (submitting the form), until you'll have 2 HTTP requests fired, with the first being aborted.

您可以使用即preventDefault()来实现这一目标。

You can use e.preventDefault() to achieve this.

我只是有这个烦恼的IE8。

I just had this trouble on IE8.

阅读全文

相关推荐

最新文章