JavaScriptで少し苦労しています。別の関数内で init 関数を呼び出す場合にのみ、次のコードが機能します。タイムアウト関数の外で this.init() または that.init() を呼び出すと、機能しません。
var App = function() {
var that = this;
// Workaround
var timeout = setTimeout(function(){
that.init();
},1);
};
var app = new App();
App.prototype.init = function() {
console.log('works');
};
助けてくれてありがとう。
乾杯。