ExtJS 2.3 - 未捕获 RangeError:超出最大调用堆栈大小
我正在扩展 HttpProxy 并预加载 24 个商店。在我添加要加载的第 24 个商店后,发生错误,我尝试仅根据请求加载它,并且在调用 laod 时发生错误。请ExtJS高手帮忙!我正在使用 ExtJS 2.3
Uncaught RangeError: Maximum call stack size exceeded
Ext.override.listeners.loadexception extensions.js:12
Ext.util.Event.fire ext-all-debug.js:1521
Ext.util.Observable.fireEvent
我在 extension.js 中的小扩展代码:
Ext.override(Ext.data.HttpProxy,{
listeners: {
'loadexception' : function(proxy, options, response){
var data = eval("(" + response.responseText + ")");
if (data.errorCode == "1") { //session expired or auth error
location.reload(true);
} else {
this.fireEvent("loadexception",proxy,options,response);
}
}
}
});
I am extending HttpProxy and pre-loading 24 Stores. The error occurs after I add the 24th Store to be loaded, I've tried loading it on request only and the error occurs as it is called to laod. ExtJS experts please help! I'm using ExtJS 2.3
Uncaught RangeError: Maximum call stack size exceeded
Ext.override.listeners.loadexception extensions.js:12
Ext.util.Event.fire ext-all-debug.js:1521
Ext.util.Observable.fireEvent
My little extention code in extension.js:
Ext.override(Ext.data.HttpProxy,{
listeners: {
'loadexception' : function(proxy, options, response){
var data = eval("(" + response.responseText + ")");
if (data.errorCode == "1") { //session expired or auth error
location.reload(true);
} else {
this.fireEvent("loadexception",proxy,options,response);
}
}
}
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
loadException
异常处理程序在else
块中抛出相同的异常
。
data.errorCode因此,如果出于某种原因
不是
1`,它会一次又一次地递归调用它。因此,调用堆栈大小超出错误。解决方案:您可以执行以下操作来防止它,
loadException
loadException
,请确保更改或处理响应,以便它不会makedata.errorCode != 1
Your
loadexception
Exception handler is throwing the same exception inelse
block.
data.errorCodeSo if somehow
is not
1` it'll recursively call it again and again. Hence the call stack size exceeding error.Solution: You can do the following to prevent it,
loadexception
in the else blockloadexception
make sure you change or process the response so that it does not makedata.errorCode != 1