
Added by thebman220 on July-3-2008, 1:30 am
function getXmlHttp() {
var xmlHttp;
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 do_ajax() {
var params=""; // Add request parameters here
var file=""; // Add the name of the request file here
var xmlHttp;
if (!(xmlHttp=getXmlHttp())) {return;}
xmlHttp.onreadystatechange=function() {
if (this.readyState==4&&this.status==200) {
// Add code to be executed when the request is complete and successful
}
}
var time=(new Date).getTime();
/**
* // for a post request, use the following:
* xmlHttp.open('POST',file+"?time="+time,true);
* xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
* xmlHttp.setRequestHeader("Content-length",params.length);
* xmlHttp.setRequestHeader("Connection","close");
* xmlHttp.send(params);
*/
xmlHttp.open("GET",file+"?"+params+"&time="+time,true);
xmlHttp.send(null);
}
Added by thebman220 on May-2-2009, 4:40 am
Added by thebman220 on April-29-2009, 11:47 pm
Added by thebman220 on April-5-2009, 1:48 pm
Added by thebman220 on January-29-2009, 3:15 am
Added by thebman220 on January-29-2009, 3:04 am
