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);

}

     }

}

你可能感兴趣的:(html,Ajax,Microsoft)