// Ajaxread ("http://page.aspx? AA = JJ & BB = 3434 ", post );
Function ajaxread (file, type ){
VaR xmlobj = NULL;
If (window. XMLHttpRequest ){
Xmlobj = new XMLHttpRequest ();
} Else if (window. activexobject ){
Xmlobj = new activexobject ("Microsoft. XMLHTTP ");
} Else {
Return;
}
Xmlobj. onreadystatechange = function (){
If (xmlobj. readystate = 4 ){
// Response data
Callback (xmlobj. responsetext );
}
}
If (file. indexof ("? ")>-1)
{
File + = "& R =" + math. Random ();
}
Else
{
File + = "? R = "+ math. Random ();
}
Switch (type. touppercase ())
{
Case "get ":
Xmlobj. Open ('get', file, true );
Xmlobj. Send (null );
Break;
Case "Post ":
Xmlobj. Open ("Post", file, true );
Xmlobj. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded ;");
VaR querystring = file. substr (file. indexof ("? ") + 1 );
Xmlobj. Send (querystring );
Break;
Default:
Break;
}
}
function callback (response)
{< br> // processing of returned values
alert (response);
}