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)();
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
2 matches
Mail list logo