复制代码 代码如下:
<script type="text/javascript">
var xmlhttp;
function creatxmlhttprequest() {
if (window.activexobject) {
xmlhttp = new activexobject("microsoft.xmlhttp");
}
else if (window.xmlhttprequest) {
xmlhttp = new xmlhttprequest();
}
}
function startrequest() {
creatxmlhttprequest();
xmlhttp.onreadystatechange = handlestatechange;
xmlhttp.open("get", "simpleresponse.xml", true);
xmlhttp.send(null);
}
function handlestatechange() {
if (xmlhttp.readystate == 4) {
if (xmlhttp.status == 200) {
// document.getelementbyid("results").innerhtml = xmlhttp.responsetext;
// alert("the server replied with:" + xmlhttp.responsetext);
}
}
}
</script>