var request; try{ request = new XMLHttpRequest();//Ie7 }cache(e){ request = new ActiveXObject('Microsoft.XMLHTTP');ie6以下 } request.open('post','http.com',true); request.send(); request.onreadystatechange = function() { if(request.readystate == 4){ if (request.status == '200'){ document.getElementById('myDiv').innerHTML = request.responseText; }else{ alert("出错了"request.status); } } }