Java Script Request Handler
var xmlHttpRequestHandler = new Object();
var requestObject;
xmlHttpRequestHandler.createXmlHttpRequest = function(){
var XmlHttpRequestObject;
if(typeof XMLHttpRequest != "undefined"){
XmlHttpRequestObject = new XMLHttpRequest();
}
else if(window.ActiveXObject){
var tryPossibleVersions = ["MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"];
for(i=0;i try{
XmlHttpRequestObject = new ActiveXObject(tryPossibleVersions[i]);
break;
}
catch(xmlHttpRequestObjectError){
// Ignore Exception
}
}
}
return XmlHttpRequestObject;
}
function puthtml(url){
requestObject = xmlHttpRequestHandler.createXmlHttpRequest();
requestObject.onreadystatechange=onReadyStateChangeResponseCopy;
requestObject.open("Get",url, true);
requestObject.send(null);
}
function onReadyStateChangeResponseCopy(){
var ready, status;
try{
ready = requestObject.readyState;
status = requestObject.status;
}
catch(e) {}
if(ready == 4 && status == 200){
txt = requestObject.responseText;
var con = document.getElementById('searchbody');
con.innerHTML = txt;
}
}
var xmlHttpRequestHandler = new Object();
var requestObject;
xmlHttpRequestHandler.createXmlHttpRequest = function(){
var XmlHttpRequestObject;
if(typeof XMLHttpRequest != "undefined"){
XmlHttpRequestObject = new XMLHttpRequest();
}
else if(window.ActiveXObject){
var tryPossibleVersions = ["MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"];
for(i=0;i
XmlHttpRequestObject = new ActiveXObject(tryPossibleVersions[i]);
break;
}
catch(xmlHttpRequestObjectError){
// Ignore Exception
}
}
}
return XmlHttpRequestObject;
}
function puthtml(url){
requestObject = xmlHttpRequestHandler.createXmlHttpRequest();
requestObject.onreadystatechange=onReadyStateChangeResponseCopy;
requestObject.open("Get",url, true);
requestObject.send(null);
}
function onReadyStateChangeResponseCopy(){
var ready, status;
try{
ready = requestObject.readyState;
status = requestObject.status;
}
catch(e) {}
if(ready == 4 && status == 200){
txt = requestObject.responseText;
var con = document.getElementById('searchbody');
con.innerHTML = txt;
}
}
Comments