Added by thebman220 on July-3-2008, 1:30 am
function getXmlHttp() {
var xmlHttp=-1;
try {
xmlHttp=new XMLHttpRequest();
} catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
return xmlHttp;
}
function <SOME_FUNCTION>() {
var xmlHttp;
if (!(xmlHttp=getXmlHttp())) {return;}
xmlHttp.onreadystatechange=function() {
if (this.readyState==4&&this.status==200) {
// stuff to do when request is complete
}
}
/**
* // for a POST request, use the following:
* http_request.open('POST',<FILE_NAME>+"?time="+((new Date).getTime()),true);
* http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
* http.setRequestHeader("Content-length", <PARAMS_LENGTH>);
* http.setRequestHeader("Connection", "close");
* http.send(<PARAMS>);
*/
xmlHttp.open("GET",<FILE_NAME>+"?"+<PARAMS>+"&time="+((new Date).getTime()),true);
xmlHttp.send(null);
}
Added by thebman220 on July-9-2008, 11:31 pm
Added by thebman220 on July-5-2008, 12:50 am
Added by thebman220 on July-5-2008, 12:03 am
Added by thebman220 on July-4-2008, 11:12 pm
Added by thebman220 on July-4-2008, 11:02 pm