While working on an IE plugin that injects an iframe onto every page, I encountered a problem with making ajax requests. To resolve this, I resorted to using IE's cross domain request instead of jQuery's ajax method, which tends to fail in IE. Surprisingly, this solution worked successfully about 75% of the time on IE8 & 9. However, in the remaining 25% of cases, the xdr.onload event wouldn't even trigger.
The PHP server seemed to be functioning correctly based on the logs, as there was no noticeable difference in the log entries between instances where onload fired and those where it didn't. Additionally, xdr.onerror did not fire either.
If anyone has any insights or ideas on how to address this issue, I would greatly appreciate the help.
thisURL = "http://example.com/getmsg.php?cmd=getMessage&iid=ddeb2c1228&uurl=http%3A%2F%2Fwww.cnn.com%2F&t=" + Math.random();
// Using Microsoft XDR
var xdr = new XDomainRequest();
xdr.open("GET", thisURL);
xdr.onload = function() {
// This alert is only sometimes triggered in IE
alert('INCONSISTENT ALERT');
callback(xdr.responseText);
};
xdr.send();