|
function loadXMLDoc(url,query_string,callback) {
xml_obj = false;
if(window.XMLHttpRequest) {
try {
xml_obj = new XMLHttpRequest();
} catch(e) {
xml_obj = false;
}
} else if(window.ActiveXObject) {
try {
xml_obj = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xml_obj = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xml_obj = false;
}
}
}
if(xml_obj) {
xml_obj.onreadystatechange = callback;
xml_obj.open("POST", url, true);
xml_obj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xml_obj.send(query_string);
}
else{
alert("Failed to create XMLHttpRequest!");
}
} |