>  기사  >  백엔드 개발  >  关于ajax的简单有关问题,求解答

关于ajax的简单有关问题,求解答

WBOY
WBOY원래의
2016-06-13 10:37:30628검색

关于ajax的简单问题,求解答。
下面是我的完整代码,为什么点了o,x,t之后都没有反应呢,按道理应该是下面会多出一些内容的,大家知道为什么吗?

var xmlHttp;
function xmlhttprequest() {

if(window.ActiveXObject){
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
}else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}

}

function funphp100(url){
xmlhttprequest();
xmlHttp.open("GET","for.php?id="+url,"true");
xmlHttp.onreadystatechange = byphp;
xmlHttp.send(null);
}

function byphp(){

if(xmlHttp.readyState==1){
document.getElementById('php100').innetHTML = "loading......";
}

if(xmlHttp.readyState==4){
if(xmlHttp.Status==200){
var byphp100 = xmlHttp.responseText;
document.getElementById('php100').innetHTML = byphp100;
}
}
}


for.php


for($i=1;$i echo $i."$id
";
}
?>


index.php




o
t
x




------解决方案--------------------
是 innerHTML 而不是 innetHTML
------解决方案--------------------
if(xmlHttp.status==200){ //小写s

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.