var Configuration = {
 MaxHttpRequest : 3
}

function Ajax()
{
 this.Version = "1.0.1";
 this.Query = new Array(Configuration.MaxHttpRequest);

 this.RequestCount = 0;
 this.XmlHttp = null; 
}

Ajax.prototype.Create = function(){
 try{
  this.XmlHttp = new XMLHttpRequest();
 }
 catch (error){
  try{
   this.XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  catch (error){
   alert('Cannot create ajax object');
   return null;
  }
 } 
}

Ajax.prototype.Send = function(method, url, callback)
{
 this.Create();
 if (null == this.XmlHttp)
 {
  return;
 } 
 this.XmlHttp.open(method, url, true); 
 this.XmlHttp.onreadystatechange = callback; 
 this.XmlHttp.send(null);
}
 

posted on 2007-07-23 22:03  孤剑  阅读(210)  评论(0编辑  收藏  举报