Internet Explorer中的jQuery.ajax PUT请求问题 [英] jQuery.ajax PUT request issue in internet explorer

查看:89
本文介绍了Internet Explorer中的jQuery.ajax PUT请求问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET MVC4 webapi,似乎通过$ .ajax发出的放置请求在使用谷歌浏览器和Firefox时效果很好,但在IE(10)中不起作用.

I am working on ASP.NET MVC4 webapi and it seems a put request via $.ajax works fine in case of google chrome and Firefox but it isn't workin in IE(10).

下面的代码:

 $.ajax({
            url: 'api/xQuizQuestion',
            type: 'PUT',
            dataType: 'json',
            data: JSON.stringify(AllQsWithAs),
            contentType: "application/json;charset=utf-8",
            success: function (data) {
                alert('Student added Successfully');
            },
            error: function () {
                alert('Student not Added');
            }
        });

在chrome/firefox中工作正常,在某种意义上说,数据 AllQsWithAs (复杂类型的数组)已添加到请求正文中,但是对于IE(10),请求正文没有数据发送.

Works fine in chrome/firefox, in sense that the data AllQsWithAs(which is an array of Complex types) gets added to the Request body, but in case of IE(10) the request body is sent without the Data.

也与Fiddler确认相同.

Confirmed the same with Fiddler as well.

令人惊讶的是,当我将浏览器模式更改为IE9/IE8或将浏览器模式更改为IE 8/9时,它工作得很好.

Surprisingly it works just fine when I change my Browser Mode to IE9/IE8 or Browser mode to IE 8/9.

不确定是什么问题.任何帮助/见解将不胜感激.

Not sure whats the issue. Any help/insight would be appreciated.

推荐答案

似乎是IE 10中的错误.

Seems to be a bug in IE 10.

我发现有报告称,将此标签添加到您的头部会以兼容模式运行脚本.

I'm finding reports that adding this tag to your head will run the scripts in compatibility mode.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >

http://code.gishan.net/code/solution -to-ie10-ajax问题/

由于无法修复而关闭了jQuery的旧错误跟踪器条目: http://bugs.jquery.com/ticket/12790

Old bug tracker entry for jQuery closed as can't fix: http://bugs.jquery.com/ticket/12790

我很难找到一个好的来源,但是可能已在最新,最出色的IE10版本中得到修复.

I'm having trouble finding a good source, but it may have been fixed in the latest and greatest IE10 release.

这篇关于Internet Explorer中的jQuery.ajax PUT请求问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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