<script type="text/javascript">
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=function()
if (xmlhttp.readyState==4 && xmlhttp.status==200)
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
xmlhttp.open("GET","/example/demo_form.aspx?fname=Bill&lname=Gates",true);
<button type="button" onclick="loadXMLDoc()">请求数据</button>