I guess this is probably an easy problem, but I cannot figure it out myself (using the wrong search criteria?).
As the title says, I want to assign a function to a variable and pass a variable to that function like this:
function doStuff(control) {
var myObj = {
"smooth": false,
"mouseup": function(value) {
jQuery(_getSelectorStringFromControlId(control.id)).blur();
}
};
}
Now I want the control.id to be replaced with its actual value before the function is assigned to the mouseup variable.
So when control.id = 'myOwnId' then myObj.mouseup should be:
function(value) {
jQuery(_getSelectorStringFromControlId('myOwnId')).blur();
}
How can this be accomplished?