function MyClass(projectName) { this.projectName = projectName; } MyClass.prototype.createHttpRequestObject = function() { /* do something */ } MyClass.prototype.submit = function(message, script, line) { httpRequest = this.createHttpRequestObject(); }
The error 'this.createHttpRequestObject is not a function' goes from line 'httpRequest = this.createHttpRequestObject();'. Why? What I do wrong?