I have a fairly large script and am trying to find out, why
$(document).on( "click", function( event ) { alert("hello"); }
Is not firing. Is there an easier way to find out why this is not working than removing all other click bindings throughout the script?
Also, I have heard that namespacing is a nice way of keeping event bindings restrictive to a certain plugin.
If so, how would I have to setup event bindings for certain event groups? Do I just replace click with click.thisGroup?
Without a complete code, I can only guess some possibilities.:
syntax error; you are not closing your handler function definition on your sample code
the element you are clicking has a call to
stopPropagation()orstopImmediatePropagation()which prevents bubbling to document thus preventing your on event attached to document