xmlhttprequest alert(xmlhttp.readystate); 提示未定义 本帖最后由 Learnfromeverthings 于 2010-11-30 22:59:46 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 只能这执行到这个函数 alert(xmlhttp.readystate);提示未定义为什么啊 function callback() { alert("callback"); alert(xmlhttp.readystate); if(xmlhttp.readystate ==4) { alert("rr"); if(xmlhttp.status ==200) { alert("gggg"); var nn = xmlhttp.responseText; alert(nn); } } } callback()方法内xmlhttp对象没定义啊,要么做成参数传进来,要么设为全局变量。 var xmlHttp = false; try { xmlHttp = new XMLHttpRequest(); } catch (trymicrosoft) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { xmlHttp = false; } } } if (!xmlHttp) {alert("启用Ajax功能失败,您可能无法使用本站的部分功能!");}....xmlHttp.open("GET",url,true); xmlHttp.onreadystatechange=ShowResult; xmlHttp.send(null); } } function ShowResult() { if(xmlHttp.readyState==4) { if(xmlHttp.status==200) { var s; s=xmlHttp.responseText; alert(s); } } } alert(xmlhttp.readystate);改为alert(xmlhttp.readyState); 对,要大写S,否则ie下正常而firefox下不正常。 对,要大写S,否则ie下正常而firefox下不正常。ie 7 以下吧 asp.net form验证模式会不会导致IIS无法访问某目录 try...catch...求教 编辑器出错,提示:当前上下文中不存在名称“editoro”要么无法识别的属性 sql分页问题 在登录后台管理页面时,发生异常 用户 'sa' 登录失败。 高分求<网上报名系统>的设计文档,或者类似系统的文档,小弟想学习一下 怎么用Jmail发送邮件 看看我的代码有什么问题吗? 如何在c#做的程序的運行後動態創建控件(如:一個button按鈕) 一点基本概念的问题 根据x,y。用google转换成实际的地址?.net VSS2005配置到最后一步了,过不去了,大家帮忙看看吧。有图有真相!
function callback()
{
alert("callback");
alert(xmlhttp.readystate);
if(xmlhttp.readystate ==4)
{
alert("rr");
if(xmlhttp.status ==200)
{
alert("gggg");
var nn = xmlhttp.responseText;
alert(nn);
}
}
}
try {
xmlHttp = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
xmlHttp = false;
}
}
}
if (!xmlHttp) {alert("启用Ajax功能失败,您可能无法使用本站的部分功能!");}
....xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=ShowResult;
xmlHttp.send(null);
}
}
function ShowResult()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
var s;
s=xmlHttp.responseText;
alert(s);
}
}
}
alert(xmlhttp.readyState);