如果您对Extjs使用Ext.ajax时报错:toomuchrecursion感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Extjs使用Ext.ajax时报错:toomu
如果您对Extjs使用Ext.ajax时报错:too much recursion感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于Extjs使用Ext.ajax时报错:too much recursion的详细内容,我们还将为您解答ext.ajax.timeout的相关问题,并且为您提供关于AJAX:HttpContext context.Session["XX"]写入时报错、ExtJS -- Ext.Ajax.request 返回结果判断、ExtJS 2.0实用简明教程之应用ExtJS_extjs、EXTJS 2.2版本在IE9中会报错:对象不支持“createContextualFrag的有价值信息。
本文目录一览:- Extjs使用Ext.ajax时报错:too much recursion(ext.ajax.timeout)
- AJAX:HttpContext context.Session["XX"]写入时报错
- ExtJS -- Ext.Ajax.request 返回结果判断
- ExtJS 2.0实用简明教程之应用ExtJS_extjs
- EXTJS 2.2版本在IE9中会报错:对象不支持“createContextualFrag
Extjs使用Ext.ajax时报错:too much recursion(ext.ajax.timeout)
首先看代码:
var record = viewmodel.get(‘current.record’);
Ext.Ajax.request({
url: ‘ims/ckcp/audit/approve’,
method: ‘POST’,
headers: { ‘Content-Type’: ‘application/json’ },
params :Ext.JSON.encode(record),
callback: function (options,success,response) {
if (success) {
var responseJson = Ext.JSON.decode(response.responseText);
var returnRecord = responseJson.data;
var success = responseJson.success;
if (success){
// viewmodel.set(‘data.record’,returnRecord);
Ext.Msg.alert(‘提示’,’账户审核通过成功’);
}
else{
Ext.Msg.show({
title:’失败’,
message: responseJson.msg,
buttons: Ext.Msg.YES,
icon: Ext.Msg.ERROR,
fn: function(btn) {
if (btn === ‘yes’) {
window.close();
}
}
});
}
} else {
Ext.Msg.confirm(‘失败’,
‘请求超时或网络故障,错误编号:[’ + response.status + ‘]是否要重新获取账户信息?’,function (btn) {
if (btn == ‘yes’) {
Ext.Ajax.request(options);
}
});
}
}
}); //ajax
我的record是grid中选中的一列,其实就是一个Ext.data.Model的对象,如果在ajax中直接提交此对象就会报以下错误: too much recursion
所以我们不能直接提交整个对象,而是将对象中的属性及值封装一下作为参数提交,请看代码:
var record = viewmodel.get('record'); var param = { data:[{ id:record.get('id'),accountNumber: record.get('accountNumber'),cardNumber: record.get('cardNumber'),subAccountNumber:record.get('subAccountNumber'),balance: record.get('balance'),hxInterest:record.get('hxInterest') }]
然后在上面的ajax中的params中提交param
AJAX:HttpContext context.Session["XX"]写入时报错
错误:POST http://localhost:52336/CampusBattle/handlers/UserHandler.ashx 500 (Internal Server Error)
描述:
无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。如果服务器位于远程计算机上,请检查 HKEY_LOCAL_MACHINE\SYstem\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection 的值,确保服务器接受远程请求。如果服务器位于本地计算机上,并且上面提到的注册表值不存在或者设置为 0,则状态服务器连接字符串必须使用“localhost”或“127.0.0.1”作为服务器名称。
ExtJS -- Ext.Ajax.request 返回结果判断
Ext.Ajax.request({ url : 'delete_Gkcsjzk.action',params : { id : record.get('id') },success : function(response,options) { myMask.hide(); if(Ext.util.Format.trim(response.responseText).indexOf("logoUT")!=-1){ App.showInfo('网页已过期,请重新登录!'); return; } //App.showObjAttr(response); var resp = Ext.util.JSON.decode(response.responseText); if(resp.success==true){ App.showInfo('删除成功!'); store.reload({ params : store.lastParams }); } else{ App.showError('出现异常,请联系管理员!'); } },failure:function(response,options){ myMask.hide(); //App.showObjAttr(response); App.showInfo('请求超时,请稍后再试或与管理员联系!'); } }); --------------------------------------------------------------------------------------------------------------------------------------- /*callback : function(options,success,response){ myMask.hide(); alert("success:"+success) App.showObjAttr(response) alert(response.isTimeout) if(Ext.util.Format.trim(response.responseText).indexOf("logoUT")!=-1){ App.showInfo('网页已过期,请重新登录!'); return; } var resp = Ext.util.JSON.decode(response.responseText); if(success==true){ App.showInfo('删除成功!'); store.reload({ params : store.lastParams }); } else{ if(typeof(resp)!='undefined'&&resp.success==false) App.showError('出现异常,请联系管理员!'); else if(typeof(resp)!='undefined'&&resp.success==true) App.showInfo('网页已过期,请重新登录!'); else App.showInfo('请求超时,请稍后再试或与管理员联系!'); } }*/ -------------------------------------------------------------------------------------------------------------------------------------- store.reload({ params : store.lastParams,callback:function(r,options,success){ myMask.hide(); var resp = Ext.util.JSON.decode(store.reader.responseText); if(success){ alert(1) } else{ if(typeof(resp)!='undefined'&&resp.success==false) App.showError('出现异常,请联系管理员!'); else if(typeof(resp)!='undefined'&&resp.success==true) App.showInfo('网页已过期,请重新登录!'); else App.showInfo('请求超时,请稍后再试或与管理员联系!'); } } });
ExtJS 2.0实用简明教程之应用ExtJS_extjs
样式文件为resources/css/ext-all.css,extjs的js库文件主要包含两个,adapter/ext/ext-base.js及ext-all.js,其中ext-base.js表示框架基础库,ext-all.js是extjs的核心库。adapter表示适配器,也就是说可以有多种适配器,因此,可以把adapter/ext/ext-base.js换成adapter/jquery/ext-jquery-adapter.js,或adapter/prototype/ext-prototype-adapter.js等。
因此,要使用ExtJS框架的页面中一般包括下面几句:
在ExtJS库文件及页面内容加载完后,ExtJS会执行Ext.onReady中指定的函数,因此可以用,一般情况下每一个用户的ExtJS应用都是从Ext.onReady开始的,使用ExtJS应用程序的代码大致如下:
<script> function fn() { alert(‘ExtJS库已加''); } Ext.onReady(fn); </script>