meflysky0001 发表于 2013-2-7 14:31:24

AJAX

try{
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
    try{
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }catch (E){
       xmlhttp = false;
    }
}
   if (!xmlhttp && typeof XMLHttpRequest!='undefined'){
       xmlhttp = new XMLHttpRequest();
   } 
xmlhttp.onreadystatechange = callback;
url=encodeURI(url);
xmlhttp.open("GET",url,true);
xmlhttp.setRequestHeader("Content-Type","text/html;charset=UTF-8");
xmlhttp.send(null);
 
 
 
 

function confirmUsercode(){
 if(xmlhttp.readyState==4){
if(xmlhttp.status ==200){
  var text = xmlhttp.responseText;
  l_flag = text;
 alert(text);
}
     }
}
页: [1]
查看完整版本: AJAX