Home  >  Article  >  Backend Development  >  ajax异步打开一个url,成功了,怎么显示出来啊

ajax异步打开一个url,成功了,怎么显示出来啊

WBOY
WBOYOriginal
2016-06-20 12:35:161020browse

rt,我用异步请求打开一个url,php编辑的显示页面,现在当前网页显示出来,用浏览器调试工具显示200,请求成功,但是网页的
右边

标记的就是没有什么,调试工具有个preview能显示出我想显示的内容,但是网页上没有显示出来啊,
新手求助,怎么让其显示在网页上啊,
在url的php中加了
header('content-type:text/html;charset=utf-8');
没效果
$('showallnodes').onclick = function(){

xmlhttp.open('GET','node/allnodes.php',true);
xmlhttp.onreadystatechange = showclass;
xmlhttp.send(null);
}

function showclass(){
if(xmlhttp.readystate == 4){
if(xmlhttp.status == 200){
$('showmenu').innerHTML = xmlhttp.responseText;
}
}
}
求助,谢谢啊


回复讨论(解决方案)

我找到原因了,是大小写的原因,readyState的s是大写的,解决了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn