I am using below code for ajax call .. it is working fine in IE but not working in Chrome it is goes to error function , Please suggest how to fix this
$.ajax({
method: 'POST',
crossDomain : true,
url: env.url,
dataType: 'json',
username: env.usrnm,
password: env.pwd,
headers : {
'Accept' : 'application/json',
'Content-Type' : 'application/json; charset=utf-8'
},
data: JSON.stringify(postdata),
timeout: envInfo.timeout,
success: function(data) {
var str = "Your request submitted";
alert(str);
window.top.opener = null;
window.close();
},
error:function(jqXHR, exception){
if(jqXHR.status != 200 && jqXHR.status != 201){
var str ="Your request not submitted";
alert(str);
window.top.opener = null;
window.close();
}
}
}); // End of Ajax Call