ICallbackEventHandler回调时的'__pendingCallbacks[...].async' is null or not an object错误处理
2008-07-19 10:53
543 查看
这时一个由于asp.net2.0客户端回调脚本中的一个bug。
function WebForm_CallbackComplete() {
for (i = 0; i < __pendingCallbacks.length; i++) {......}
}
上面黄色标示的代码中使用的全局变量i,因此而产生的错误。
正确代码:for (var i = 0; i < __pendingCallbacks.length; i++) {......}
由于以下几种情况引起
1、 连续调用回调函数或嵌套调用回调函数
2、回调处理函数中存在变量i
1、解决方法
在连续调用或嵌套调用回调函数时使用setTimeout来调用。
例如:setTimeout("WebForm_DoCallback('call',0,GetCallBack,'',null,false)",1);
setTimeout("WebForm_DoCallback('call',1,GetCallBack,'',null,false)",1);
2、解决方法
function GetCallBack(arg,context)
{
//这个回调用处理函数中不要使用变量
}
function WebForm_CallbackComplete() {
for (i = 0; i < __pendingCallbacks.length; i++) {......}
}
上面黄色标示的代码中使用的全局变量i,因此而产生的错误。
正确代码:for (var i = 0; i < __pendingCallbacks.length; i++) {......}
由于以下几种情况引起
1、 连续调用回调函数或嵌套调用回调函数
2、回调处理函数中存在变量i
1、解决方法
在连续调用或嵌套调用回调函数时使用setTimeout来调用。
例如:setTimeout("WebForm_DoCallback('call',0,GetCallBack,'',null,false)",1);
setTimeout("WebForm_DoCallback('call',1,GetCallBack,'',null,false)",1);
2、解决方法
function GetCallBack(arg,context)
{
//这个回调用处理函数中不要使用变量
}
相关文章推荐
- '__pendingCallbacks[...].async' is null or not an object: callback async[i]...FIX :)
- '__pendingCallbacks[...].async' is null or not an object
- “this._postbackSettings.async is null or not an object”问题的解决
- dojo.widget' is null or not an object
- 使用jqplot绘图出现window.G_vmlCanvasManager is null or not an Object
- 使用flot绘图出现window.G_vmlCanvasManager is null or not an Object
- TypeError: 'bases' is null or not an object。IE8 bug 腐朽的对象
- 使用flot绘图出现window.G_vmlCanvasManager is null or not an Object
- 'this.m_clientController' is null or not an object - ReportViewer
- document.getElementById(...) is null or not an object
- ASP.NET 2.0 – ValidatorOnLoad “Microsoft Javascript runtime error: ‘null’ is null or not an object”
- C# 编程遇到An object reference is required for the non-static field, method, or property错误
- ERROR: a parameter or an operation is not supported by the underlying object
- 用命令连接mysql , 出现'mysql' is not recognized as an internal or external command错误解决
- AlertDialog显示错误 Unable to add window token null is not for an application
- 【错误处理】Angular报错:ERROR in MessageDetailComponent is not an NgModule
- DevExpress Exception Solution - The target "X" for the callback could not be found or did not implement ICallbackEventHandler
- warning:reset()[function.reset]:passed variable is not an array or object
- Ionic/Angular TypeScript 错误:Object prototype may only be an Object or null: undefined的解决办法
- AlertDialog显示错误 Unable to add window token null is not for an application