状态老是只到readystate==1 我的服务端是java,请求后服务端返回如下JSON格式的字符串数据: {"aniFrames":[{"frameid":"137","ftime":"200","fwidth":"400","fheight":"400"}] } 但之后就没反应了,我跟了一下,页面就只到了readystate为1的状态,就没有了,请教各位大侠是什么原因呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //代码片段,来自http://www.easyui.org.cn post:function(sUrl,sArgs,bAsync,fCallBack,fFailure){ var xhr = this.init(); if(!xhr){alert('XmlHttp对象未就绪!');return;} xhr.onreadystatechange = function(){//这里绑定状态更改事件 if(xhr.readyState == 4){ if(xhr.status == 200){ if(fCallBack&&fCallBack.constructor==Function){fCallBack(xhr);} }else{ if(fFailure&&fFailure.constructor==Function){ fFailure(xhr); }else{ alert('服务器错误:'+xhr.status); } xhr = null; } } }; xhr.open('POST',encodeURI(sUrl),bAsync); xhr.setRequestHeader('Content-Length',sArgs.length); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xhr.send(sArgs); javascript知识点终结,特别是高级特性 怎么打开一个拥有独立的session的IE新窗口 数组的问题 急 在线等 多麻烦各位大侠了 一个关于javascript的奇怪问题 javascript能不能格式化数字的显示:数字1显示为01 为空或不是对象---问题大讨论---100分 请问form能不能这么做 在javascript中createElement是什么意思? 怎样在javascript中打开窗口并传递值? jquery在firefox下不能运行 怎么样验证用户输入的字符串中不可以包含单上引号'
//代码片段,来自http://www.easyui.org.cn post:function(sUrl,sArgs,bAsync,fCallBack,fFailure){
var xhr = this.init();
if(!xhr){alert('XmlHttp对象未就绪!');return;}
xhr.onreadystatechange = function(){//这里绑定状态更改事件
if(xhr.readyState == 4){
if(xhr.status == 200){
if(fCallBack&&fCallBack.constructor==Function){fCallBack(xhr);}
}else{
if(fFailure&&fFailure.constructor==Function){
fFailure(xhr);
}else{
alert('服务器错误:'+xhr.status);
}
xhr = null;
}
}
};
xhr.open('POST',encodeURI(sUrl),bAsync);
xhr.setRequestHeader('Content-Length',sArgs.length);
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send(sArgs);