function FakeClass(){};
FakeClass.prototype.someMethod = function(){};
FakeClass.prototype.otherMethod = function(){
//need to call someMethod() here.
}
I need to call someMethod from otherMethod, but apparently it doesn't work. If i build it as a single function (not prototyped), i can call it, but calling a prototyped does not work. How can i do it as if i was treating the function just like a class method?
Update: I'm calling the method after a jQuery event is triggered. Does it affect the way the whole thing behaves?
function CicloviarioEngine(){};
CicloviarioEngine.prototype.test = function(){
alert("Hey");
}
CicloviarioEngine.prototype.initialize = function(){
$('#add-route').click(function(){
this.test(); //doesn't work
CicloviarioEngine.test(); //doesn't work
externalTest(); //works
});
}
function externalTest(){
alert("externalTest()");
}