【发布时间】:2013-07-27 03:18:25
【问题描述】:
我有以下代码:
define(["dojo/_base/declare"],function (declare) {
return declare("tamoio.Map", null, {
methodA: function(param){
console.log(param);
this.methodB('xxx',function(){
this.methodC(); //it didn't call!
});
},
methodB: function(text, callback){
alert('do nothing: ' + text);
callback();
},
methodC: function(){
alert('hello');
}
});
});
当我运行我的应用程序时,我收到了消息:
Uncaught TypeError: Object [object global] has no method 'methodC'
如何在我的模块中调用内部方法?
我正在使用 Dojo 1.9.1
最好的问候,
仁南
【问题讨论】:
-
伙计们,我将函数 methodC 作为回调函数传递,然后是另一个函数
标签: javascript function dojo callback scope