Here is what you need to have:
--------------------------------
function createRequestObject(){
var request_;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_ = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_ = new XMLHttpRequest();
}
return request_;
}
var http = createRequestObject();
function reload(page,param,refreshlocation) {
http.open('get', page+'?'+param);
http.onreadystatechange = function(){
if (http.readyState == 4)
{
var response = http.responseText;
document.getElementById(refreshlocation).innerHTML = response;
}else {
document.getElementById(refreshlocation).innerHTML = "Loading...";
}
}
http.send(null);
}
No comments:
Post a Comment