[jQuery] Re: Callback problem

2009-01-22 Thread jQuery Lover
I have tried this: var handler = editElementName; function editElementNameSave() { alert('Hurray!'); console.log(1); } function showModalBox(handler) { $(.1).click(function(){ console.log(2); (handler + Save)();

[jQuery] Re: Callback problem

2009-01-22 Thread Michael Geary
Alex's code was doing the equivalent of: $(.btnSave).click(editElementNameSave); The click() function, like all event functions, expects to receive a *reference* to a function, not the *name* of a function. Your code is doing the equivalent of: editElementNameSave(); You can't call a string