Loading ...

IE10 jquery ajax post not working, data not posted to server | CodeAsp.Net

IE10 jquery ajax post not working, data not posted to server

 /5
0 (0votes)

After upgrading IE to IE10 on my machine (Windows 7 64 bit) I was facing weird issues with ajax "POST" calls. We had a problem with posting messages in our product CommunifireThe data was not posted to server with IE10, I confirmed that with fiddler. The same was working with IE8, IE9, FF, Chrome and Safari. I tried all the below mentioned stuff in IE10 to POST data to server:

$.ajax({
        url:"/login",
        type: "POST",
        data: {name:name, password:pass},
        dataType: "json"
    }).done(success);

 $.post("/login", {name:name, password:pass}, sucess);


even changing

data: {name:name, password:pass}

to 

data: {"name":name, "password":pass}


but none was working. I will add one more information here regarding the version of IE 10, it is 10.0.9200.16618, that latest while I am writing this blog.

This seems to be bug in IE10 and has not beed fixed so far (28th June 2013). It is even reported here http://bugs.jquery.com/ticket/12790#comment:22

More..

http://bugs.jquery.com/ticket/12790#comment:28

Solution:

The solution is to add the following meta tag:

<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >



by adding the above meta tag, IE10 will run your javascript in IE9 compatible mode
.

Adding that tag fixed my issue and with that tag added I have confirmed the ajax post calls working in IE10 along with IE9 and IE8 too.

Comments (no comments yet)

Top Posts