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

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…)

Categories

July 2017
S M T W T F S
« May    
 1
2345678
9101112131415
16171819202122
23242526272829
3031