$("#submitbutton").button().click(function() {
var request = $.ajax({
type: "post",
url: "mmm.php",
data:"abc=abcdefghijklmnopqrstuvwxyz",
success:function(data){ alert("success: " +data); },
error:function(data){ alert("error "+data); },
statusCode:{
200:function(){alert("200");},
304:function(){alert("304");},
404:function(){alert("404");}},
isModified:function(){alert("Something was modified");}
});
This Post on IE9 is replied correctly. On chrome, It generates error alert with the following: “error [Object][Object]”
Chrome Console show no error, server replies:
for IE:
10.0.0.4 – – [22/Jul/2012:18:00:22 +0300] “GET /development-bundle/ui/jquery.ui.button.js HTTP/1.1” 200 11342 “http://xxxx.xxxx.net/first.html” “Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)”
For Chrome:
10.0.0.4 – – [22/Jul/2012:18:08:34 +0300] “GET /development-bundle/ui/jquery.ui.button.js HTTP/1.1” 304 – “http://xxxx.xxxxxx.net/first.html?” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11”
Any idea why chrome adds a question mark after the ‘first.html’ and IE don’t ? It causes the apache server to return 304 that looks to Chrome as error
thank you
you would want to first fix your jSon that you wish to pass to the server.. it is incorrect currently.. change it to the following and then try.
I also modified your event binding, the
button()call doesnt seem necessary.