You are currently browsing the tag archive for the ‘ajax’ tag.

I’m just digging into AJAX (I know, I’m behind the times) and I wanted to save what I’m sure will be oft-used code snippets!! Mainly this one.


var XMLHttpRequestObject = false;

if (window.XMLHttpRequest) {
   XMLHttpRequestObject = new XMLHttpRequest();
} else if (window.ActiveXObject) {
   XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}

function f()
{
   if(XMLHttpRequestObject) {
     XMLHttpRequestObject.open("GET", );

     XMLHttpRequestObject.onreadystatechange = function()
     {
        if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
        }
     }

   XMLHttpRequestObject.send(null);
   }
}

From Ajax for Dummies (similar code all over the world…)

Advertisements

Categories

September 2017
S M T W T F S
« May    
 12
3456789
10111213141516
17181920212223
24252627282930