Hi,
Using prototype.js, I create a custom object which is going to be a parameter on a constructor :
var options = Object.extend({month: date[0],
year: date[1],
day: date[2],
oncalchange: update});
// update is defined like that :
var update = function(d){
// bla bla
}
// Calling my class
var myObject = new myClass (options);
On the oncalchange option, I have a callback function called "update", which takes a parameter within myClass.
Now, I want to pass an extra parameter to the "update" function, but not directly in the class.
I would like to do something like that :
// element is the parameter I want to add
var update = function(d, element){
alert(element);
}
Obviously it doesn't work, how could I do something similar ?