Hacked By AnonymousFox
Current Path : C:/AppServ/www/th/lib/ |
|
Current File : C:/AppServ/www/th/lib/XMLHttpObject.js |
//#################################################
function getXMLHttpObject() {
//#################################################
var xmlhttp;
if(window.XMLHttpRequest) { // branch for native XMLHttpRequest object
try {
xmlhttp = new XMLHttpRequest();
} catch(e) {
xmlhttp = false;
}
} else if(window.ActiveXObject) { // branch for IE/Windows ActiveX version
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlhttp = false;
}
}
}
return xmlhttp;
}
//#################################################
function refreshXMLHttpData(myPath,objectFunction) {
//#################################################
if (XMLHttpObject.readyState == 4 || XMLHttpObject.readyState == 0) {
XMLHttpObject.open("POST",myPath,true);
XMLHttpObject.onreadystatechange = objectFunction;
XMLHttpObject.send(null);
}
}
function refreshXMLHttpData2(myPath,myParam,objectFunction) {
//#################################################
if (XMLHttpObject.readyState == 4 || XMLHttpObject.readyState == 0) {
XMLHttpObject.open("POST",myPath,true);
//Send the proper header information along with the request
XMLHttpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
XMLHttpObject.setRequestHeader("Content-length", myParam.length);
XMLHttpObject.setRequestHeader("Connection", "close");
XMLHttpObject.onreadystatechange = objectFunction;
//XMLHttpObject.send(null);
XMLHttpObject.send(myParam);
}
}
/*
// Sample function for get XML data text , plese copy to your script
function getXMLHttpDataText() {
if (XMLHttpObject.readyState == 4) {
results = XMLHttpObject.responseText;
alert(results);
}
}
*/
//#################################################
//----------- for IE --------------------------------------------------------------
function submitXMLHttp(myPath,objectFunction) {
//#################################################
//objectFunction = getXMLHttpData;
refreshXMLHttpData(myPath,objectFunction);
}
//#################################################
//----------- for Firefox --------------------------------------------------------------
function submitXMLHttp2(myPath,myParam,objectFunction) {
//#################################################
//objectFunction = getXMLHttpData;
refreshXMLHttpData2(myPath,myParam,objectFunction);
}
if (!XMLHttpObject) var XMLHttpObject = getXMLHttpObject();
Hacked By AnonymousFox1.0, Coded By AnonymousFox