onReady: function(){
this.readjiage('button1');//此處為什么必須要加this,在同級(jí)別的函數(shù)不能直接調(diào)用嗎。不加this,就說(shuō)未定義。
},
readjiage: function (id) {
console.log(id);
},
網(wǎng)友回復(fù):
你這是定義在對(duì)象內(nèi)的方法,當(dāng)然要用this引用,要是想要全局函數(shù)就把function的定義移到外面,用function abc()的形式定義
哦,明白了,謝謝。