The Mysolutions

26Jan/111

Clasic Ajax Script

The Simple Ajax Script is:

function getXmlHttpReq(){
var req;
if(window.XMLHttpRequest && !(window.ActiveXObject)) {
try{
req = new XMLHttpRequest();
}
catch(e){
req = false;
}
// branch for IE/Windows ActiveX version
}
else if(window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
req = false;
}
}
}
return req;
}

Filed under: Ajax Leave a comment
Comments (1) Trackbacks (0)
  1. Yes, its the classic javascript for ajax operation. It is easy to use. But now jquery is most valuable library for ajax.


Leave a comment

(required)

No trackbacks yet.