Here's that Ajax call wrapper...
- function InitiateAjaxRequest(url, callBack)
- {
- var http = getHTTPObject(); // Create the HTTP Object
- http.onreadystatechange = function()
- {
- if ((http.readyState == 4) && (http.status == 200))
- callBack(http.responseText);
- };
- http.open("GET", url, true);
- http.send(null);
- }
So now, all I have to do on the page is...
- function onSomeUIEvent()
- {
- InitiateAjaxRequest("someBusinuessPage.aspx?CustID=42", onRecvdCustDetails);
- }
- function onRecvdCustDetails(responseText)
- {
- // do something with reponseText
- }
Suh-weet.
Comments