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

February 2018
S M T W T F S
« May    
 123
45678910
11121314151617
18192021222324
25262728  
Advertisements