Let's say I have a javascript function as follows:
car.prototype = {
this.stolen = "",
initialize: function(){
this.stolen = false;
},
steal: function(){
Event.observe(window, "resize", function(){
this.stolen = true;
});
}
}
In the steal
method, how can I refer to the stolen
property of the car
object within the Event.observe()
method? In the code above, this
in the Event.observe()
method is referring to the window instead of the car
object.