jquery on click event that call a named function -
i have jquery onclick handler, writed anonymous function that:
$("#selector").on("click" function(){     // })   i generalize anonymous function extracting logic in named function, drive me like:
$("#selector").on("click" namedfunction())  function namedfunction(){     // }   to me seemed solution. there's drawback since namedfunction executed script loaded. here can test bad behaviour.
just pass reference of function itself.
try,
$("#selector").on("click", namedfunction);      
Comments
Post a Comment