Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>&lt;SCRIPT language=javascript&gt; // Needed for IE6 and older to replicate the standard XMLHttpRequest object if (window.ActiveXObject &amp;&amp; !window.XMLHttpRequest){window.XMLHttpRequest = function(){progIds=new Array("Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP", "Microsoft.XMLHTTP");for(i in progIds){try{return new ActiveXObject(progIds[i]);}catch(ex){alert(progIds[i]);}}return null;};} // Standard asynchonous AJAX code var xhr = new XMLHttpRequest(); // You would normally trade out the location.href with an actual .ashx // page. It's like this here only for testing, thereby requesting this // same page back from the server. xhr.open("POST",location.href,true); // The function that will be called asynchronously when the server sends // back its response xhr.onreadystatechange=function(){ // If you're using the file system instead of a web server then xhr.status // will come back as 0, not 200. And of course if the page isn't found // then a web server will send back a status of 404. xhr.readyState is 4 // when the page is done. if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) { clearTimeout(xhrTimeout); // Looks like we didn't time out! // Use xhr.responseText to parse the server's response alert(xhr.responseText); } } // Now that we're ready to handle the response, we can make the request xhr.send("My excellent post info"); // Timeout to abort in 5 seconds var xhrTimeout=setTimeout("ajaxTimeout();",5000); function ajaxTimeout(){ xhr.abort(); alert("Well dang, the AJAX request timed out. Did you lose network "+ "connectivity for some reason?"); // Note that at this point you could try to send a notification to the // server that things failed, using the same xhr object. } &lt;/SCRIPT&gt; </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. VO
      singulars
      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