How can I add a function reference to an object literal
- by rob
I need to add binders to DOM elements after rendering is done. Therefore I want to pass a list with (ID, callback) tuples to the rendering function so it can bind it after the rendering is done.
So i would like to create a list of such objects and pass it to the rendering function:
{id:'#someDOMelement', callback: someObject.someFunction}
and bind it after the rendering like this:
$(binders[i].id).bind('click', binders[i].callback);