コールバック関数でメソッドを呼び出そうとしています。
jsTest.prototype.getTitle = function() {
thisJS=this
//the console will returns my object...so it's not undefined.
console.log(thisJS);
//codes.....
//ajax callback function
ajaxcall.callback=function(data){
//call the addName method
thisJS.addName(data, 1);
};
}
jsTest.prototype.addName=function(data, bool){
console.log(data);
}
と言うエラーが出ました
Uncaught TypeError: Cannot call method 'addName' of undefined
これを解決する方法はありますか?本当にありがとう!