Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, the problem was down to weirdnesses in IE8 &amp; 9 which were solved with a few suggestions from this article: <a href="http://cypressnorth.com/programming/internet-explorer-aborting-ajax-requests-fixed/">http://cypressnorth.com/programming/internet-explorer-aborting-ajax-requests-fixed/</a> (mainly setting some blank handler functions and wrapping the .send() in a 0 timeout).</p> <p>Here's my final code which works in ie8/9/10/11 &amp; FF/Chrome:</p> <pre><code>function doRequest(url) { // Create the XHR object. var xhr = new XMLHttpRequest(); if ("withCredentials" in xhr) { // XHR for Chrome/Firefox/Opera/Safari. xhr.open('get', url, true); }else if(typeof XDomainRequest != "undefined") { // XDomainRequest for IE. xhr = new XDomainRequest(); xhr.open('get', url); }else{ // CORS not supported. xhr = null; }; if (!xhr) { return; }; // Response handlers. xhr.onload = function() { //do what you want with the response. Remember to use xhr.responseText for ie8 compatibility, because it doesn't have .responseXML if(xhr.responseXML) { xml = this.responseXML; }else if(xhr.responseText){ xml = new ActiveXObject('Microsoft.XMLDOM'); xml.loadXML(xhr.responseText); }; }; xhr.onerror = function() { //do what you want on error }; //these blank handlers need to be set to fix ie9 http://cypressnorth.com/programming/internet-explorer-aborting-ajax-requests-fixed/ xhr.onprogress = function () { }; xhr.ontimeout = function () { }; //do it, wrapped in timeout to fix ie9 setTimeout(function () { xhr.send(); }, 0); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload