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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -