I am making an Ajax call with a cross zone.
My code is:
if (window.XDomainRequest)
{
xdr = new XDomainRequest();
if (xdr) {
xdr.timeout = 3000;
xdr.onload = function () {
alert("Success");
};
xdr.onerror = function () {
alert("Error");
};
xdr.ontimeout = function () {
alert("Error");
};
xdr.open("post", urlSearch);
xdr.send();
}
}
else {
$.ajax({
url: urlSearch,
type: 'POST',
dataType: 'json',
timeout: 3000,
success: function (data) {
alert("Success");
},
error: function () {
alert("Error");
}
});
}
The above code works fine in all browsers, but in IE sometimes an error like (interrupted) appears.
To overcome this error, I searched on Google and did not find a suitable solution.
You can see the error message in which it is displayed (interrupted).
http://postimg.org/image/k01u6t9v5/
When I make an individual call to a specific URL, it does not show any (interrupted) messages (showing a alert about the readiness). But when I make some calls (for example, in the image), it shows this type of error.
How to overcome this problem?
Please, help
Thanks in advance
source
share