admin管理员组文章数量:1291921
My AJAX is not working and I cannot figure out why. What am I missing??
ReferenceError: xmlhttp is not defined @ javascript.js:5
function insapts(pin){
if (window.XMLHttpRequest){ xmlhttpp=new XMLHttpRequest(); }else{ xmlhttpp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttpp.onreadystatechange=function(){
if(xmlhttpp.readyState==4 && xmlhttpp.status==200){
document.getElementById('apttimeins').innerHTML = xmlhttp.responseText;
}
}
var url = "bridge3.php?pin="+pin;
xmlhttpp.open("GET",url,false);
xmlhttpp.send(null);
}
My AJAX is not working and I cannot figure out why. What am I missing??
ReferenceError: xmlhttp is not defined @ javascript.js:5
function insapts(pin){
if (window.XMLHttpRequest){ xmlhttpp=new XMLHttpRequest(); }else{ xmlhttpp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttpp.onreadystatechange=function(){
if(xmlhttpp.readyState==4 && xmlhttpp.status==200){
document.getElementById('apttimeins').innerHTML = xmlhttp.responseText;
}
}
var url = "bridge3.php?pin="+pin;
xmlhttpp.open("GET",url,false);
xmlhttpp.send(null);
}
Share
Improve this question
asked Nov 22, 2013 at 4:32
I wrestled a bear once.I wrestled a bear once.
23.4k20 gold badges72 silver badges121 bronze badges
1 Answer
Reset to default 6You have a typo. The XMLHttpRequest
object is created with the local variable name xmlhttpp
.
Change
xmlhttp.responseText;
to
xmlhttpp.responseText;
// ^ missing p
本文标签: javascriptReferenceError xmlhttp is not definedStack Overflow
版权声明:本文标题:javascript - ReferenceError: xmlhttp is not defined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741542777a2384418.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论