【发布时间】:2014-05-02 00:23:43
【问题描述】:
我是 javascript 的菜鸟,当我尝试使用原型来扩展我的对象时,我收到以下错误代码:
Object function ProcessManager() {...} has no method 'startBrowsing'
这是我的代码。我在 nodejs 中执行这段代码。
代码
function ProcessManager(){
this.browser = new Browser();
this.salePagesToVisit = [];
this.salePagesCurrent = [];
this.salePagesDone = [];
this.categoryPagesToVisit = [];
this.categoryPagesCurrent = [];
this.categoryPagesDone = [];
this.listPagesToVisit = [];
this.listPagesCurrent = [];
this.listPagesDone = [];
}
ProcessManager.prototype.startBrowsing = function () {
winston.log('verbose', 'Starting scrapping Bazarchic');
}
var processManager = new ProcessManager();
ProcessManager.startBrowsing();
【问题讨论】:
标签: javascript node.js object prototype