I have a jQuery onClick handler, writed with an anonymous function like that:
onClick
$(\"#selector\").on(\"click\" function(){ // do something }) <
Just pass the reference of that function itself.
reference
Try,
$("#selector").on("click", namedFunction);