var request;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}else{
request=new ActiveXObject("Microsoft XMLHTTP");
}
request.onreadystatechange=function(){
if(request.readyState===4&&request.status===200){
document.getElementById("ID").innerHTML=request.responseText;
}
}
request.open("POST","https://www.baidu.com",true);//三个值:请求方式GET或者POST;请求地址;是否异步
request.send();