为什么能在控制台显示,不能再页面上显示查询结果?
<script type="text/javascript">
//发送Ajax查询请求并处理
document.getElementById("search").onclick=function(){
var request;
if(window.XMLHttpRequest){
request=new XMLHttpRequest();
}else{
request=new ActiveXObject("Microsoft.XMLHTTP");
}
request.open("GET","server.php?number="+document.getElementById("keyword").value);
request.send();
request.onreadystatechange=function(){
if(request.readystate===4&&request.status===200){
document.getElementById("searchRearch").innerHTML=request.responseText;
}else{
alert("出现错误:"+request.status);
}
}
}