js 代码
- <script type=< span="">"text/javascript">
- var xmlhttp
- function loadXMLDoc(url)
- {
- xmlhttp=null
- // Mozilla
- if (window.XMLHttpRequest)
- {
- xmlhttp=new XMLHttpRequest()
- }
- // IE
- else if (window.ActiveXObject)
- {
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
- }
- if (xmlhttp!=null)
- {
- xmlhttp.onreadystatechange=state_Change
- xmlhttp.open("GET",url,false)
- xmlhttp.send(null)
- }
- else
- {
- alert("你的浏览器不支持 XMLHTTP!")
- }
- }
- function state_Change()
- {
- // xmlhttp 加载完成
- if (xmlhttp.readyState==4)
- {
- // 处理成功
- if (xmlhttp.status==200)
- {
- alert("XML数据处理成功!")
- document.getElementById('A1').innerHTML=xmlhttp.status
- document.getElementById('A2').innerHTML=xmlhttp.statusText
- document.getElementById('A3').innerHTML=xmlhttp.responseText
- }
- else
- {
- alert("XML检索结果:" + xmlhttp.statusText)
- }
- }
- }
- </script>