我遇到了以下問題,它真的讓我難住了:調用成員函數
我
function SystemList(UID)
{
this.refreshData();
}
SystemList.prototype.refreshData = function()
{
this.systemDataObj({}, $.proxy(this.readSuccess, this));
}
當我嘗試和運行它,我得到以下錯誤:未捕獲TypeError:Object#在構造函數中沒有方法'refreshData'。
任何人都有一個想法,爲什麼這是失敗?在我看來,它看起來應該起作用。
編輯:
function UserMiniProfile(UID)
{
this.UID = UID;
this.systemList = new SystemList(this.UID);
this.htmlID = 'user-'+this.UID+'-profile';
}
添加了一個如何創建obj的示例。 – nazbot 2010-06-24 05:04:11
確定在擴充其原型後使用'SystemList'構造函數*嗎? – CMS 2010-06-24 05:09:45
適用於我:http://jsbin.com/ebasa/edit – nickf 2010-06-24 05:10:16