John Resigs Simple Javascript Inheritance: http://ejohn.org/blog/simple-javascript-inheritance/
I tried to do such a thing:
var SomeClass = Class.extend({ init: function() { var someFunction = function() { alert(this.someVariable); }; someFunction();
This should warn "someString", but this is not because inside the function closing someFunction, the value of this is not a class, it has changed. This does not allow me to access the properties and functions of the class inside the closure function.
Any suggestions?
source share