I have this code that I am using and it works fine in chrome, but in IE, it looks like that onreadystatechenge is not firing.
How do I get this to work cross browser. I
Apparently IE 11 (which I assume is what you are testing is broken) removed script.onreadystatechange
in favor of script.onload
.
Here is the compatibility for xhr.onload.
Source of IE11 removing it
Your XMLHttpRequest
object might be caching.
Try:
var myNoCachePage = document.location + '?' + new Date().getTime();
xhr.open("GET", myNoCachePage, true); // Prevent IE11 from caching
xhr.send();