1
比方說,我有一個類:JavaScript對象是函數的範圍
var asdf = new Class({
myFunction: function() {
//some stuff here
},
anotherFunction: function() {
globalObject.dosomethingandusecallback(
function() { // this is the callback
//how do I call myFunction() here? I can't seem to get it to work?
}
);
}
});
我似乎在試圖我的回調函數的定義中調用myFunction的一些範圍界定問題。我在這裏錯過了什麼?我認爲它應該在這種情況下訪問myFunction?
謝謝!