js 代码
  1. "text/javascript">   
  2. var xmlhttp   
  3.   
  4. function loadXMLDoc(url)   
  5. {   
  6. xmlhttp=null  
  7. // Mozilla   
  8. if (window.XMLHttpRequest)   
  9.   {   
  10.   xmlhttp=new XMLHttpRequest()   
  11.   }   
  12. // IE   
  13. else if (window.ActiveXObject)   
  14.   {   
  15.   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")   
  16.   }   
  17. if (xmlhttp!=null)   
  18.   {   
  19.   xmlhttp.onreadystatechange=state_Change   
  20.   xmlhttp.open("GET",url,false)   
  21.   xmlhttp.send(null)   
  22.   }   
  23. else  
  24.   {   
  25.   alert("你的浏览器不支持 XMLHTTP!")   
  26.   }   
  27. }   
  28.   
  29. function state_Change()   
  30. {   
  31. // xmlhttp 加载完成   
  32. if (xmlhttp.readyState==4)   
  33.   {   
  34.   // 处理成功   
  35.   if (xmlhttp.status==200)   
  36.   {   
  37.   alert("XML数据处理成功!")   
  38.   document.getElementById('A1').innerHTML=xmlhttp.status   
  39.   document.getElementById('A2').innerHTML=xmlhttp.statusText   
  40.   document.getElementById('A3').innerHTML=xmlhttp.responseText   
  41.   }   
  42.   else  
  43.   {   
  44.   alert("XML检索结果:" + xmlhttp.statusText)   
  45.   }   
  46.   }   
  47. }   
  48.   
  49.   
评论
发表评论

您还没有登录,请登录后发表评论

bruce.lu
搜索本博客
存档
最新评论