car
2016-11-01 14:25:51浏览 2518
var xmlHttp;
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest){
xmlHttp=new XMLHttpRequest();
}
xmlHttp.onreadystatechange=function(){
var result;
if(xmlHttp.readyState===4){
if(xmlHttp.status===200){
document.title=xmlHttp.responseXML.getElementsByTagName("response")[0].childNodes[0].nodeValue;
}
}
}
xmlHttp.open("get","response.xml");
xmlHttp.send(null);
<?xml version="1.0" encoding="UTF-8"?>
<response>message</response>