【www.gdgbn.com--jquery】


function createXMLHttpRequest(){
  if(window.ActiveXObject){
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  }else if(window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();
  }
}
function startRequest(url,returnfun) {
   createXMLHttpRequest();
   xmlHttp.onreadystatechange =returnfun;
   xmlHttp.open("GET",url,true);
   xmlHttp.send(null);   

}
function weatherStateChange(){
  if(xmlHttp.readyState == 4){
   $("ipweather").innerHTML=xmlHttp.responseText;
  }
  
}

本文来源:http://www.gdgbn.com/wangyezhizuo/20766/