Here's that Ajax call wrapper...

  1. function InitiateAjaxRequest(url, callBack)    
  2. {    
  3.   var http = getHTTPObject(); // Create the HTTP Object    
  4.     
  5.   http.onreadystatechange = function()    
  6.   {    
  7.     if ((http.readyState == 4) && (http.status == 200))    
  8.       callBack(http.responseText);    
  9.   };    
  10.   
  11.   http.open("GET", url, true);    
  12.   http.send(null);    
  13. }    


So now, all I have to do on the page is...

  1. function onSomeUIEvent()    
  2. {    
  3.   InitiateAjaxRequest("someBusinuessPage.aspx?CustID=42", onRecvdCustDetails);    
  4. }    
  5.      
  6. function onRecvdCustDetails(responseText)    
  7. {    
  8.   // do something with reponseText  
  9. }    


Suh-weet.

Comments

Popular Posts