A question about John Resig's Simple Javascript Inheritance.
- by Zippo
I'm using this simple code: http://ejohn.org/blog/simple-javascript-inheritance/
Using this "library", I made this simple class:
var Person = Class.extend({
init: function(openningSentence) {
this.say(openningSentence);
},
say: function(words) {
alert(words);
}
});
The problem with this class, is that I can't call a function using the variable "this" (line 3 in the code gives an error: unknown method "say").
Does anybody knoes if there's a solution for this problem?
Btw - I'm using jquery, so if there's a jquery-based solution It'll be great :)