Is it Right?

Hi,

I wrote some ajax function, learn from one website.

this is the source code.

muthuraja=(function(){
function connectobj(){
var cobj;
if (window.XMLHttpRequest){
cobj=new XMLHttpRequest();
}
else{
cobj=new ActiveXObject(“Microsoft.XMLHTTP”);
}
return cobj;
}
function callfn(o,fn){
var inter=window.setInterval(function(){
if((o.readyState==4) && (o.status==200)){
clearInterval(inter);
fn(o.responseText);
}
},50)
}
return function(url,callbackfunction,method,params){
var cobj=connectobj();
cobj.open(method?method:‘GET’,url,true);
params=params?params:null;
callfn(cobj,callbackfunction);
cobj.send(params);
return cobj;
};
})();

Is it Right?
If any mistake i made please correct me?

MuthuRaja S