Hello
I have this similar code:
var SomeVar = Class.create({
one: null,
two: null,
three: null,
initialize: function(one, two) {
this.one = one;
this.two = two;
},
startListeners: function() {
$j('#somediv1').mousedown(function(e) {
this.three=3;
three="hi"
}.bind(this));
$j('#somediv2').mousedown(function(e) {
console.log(this.three);
console.log(three);
}.bind(this));
},
});
As you see there are more can one variable called "three". What is the best way to have one common variable named three where I can modifiy it freely and it does not get deleted/destroyed everytime I do a mousedown on divone then on divtwo it comes out null.
It may be related but what the hell is "}.bind(this));"?