2
votes
3answers
150 views

jQuery - When to Bind Event Listeners?

I'm building a medium-sized "single-page" JavaScript application using jQuery. If you include all possible functionality of the application, there are 134 click bindings. Since most of the content is ...
0
votes
1answer
269 views

How does jQuery's mechanism of event handlers work

I'm in the need of widen my perspective on the framework libraries, to be able to make well aware choices of if/which/when to add a framework to a website. One thing that got my attention was event ...
0
votes
3answers
164 views

When/Where to create/assign event handlers to its elements

Lets say I have the following code // JS $(function(){ $('[data-mc=logout]').click(function(){ if (!confirm(myconfig.msg['asklogout'])) { return false; ...
1
vote
1answer
184 views

Global vs Individual object event handlers

Lately I've been studying a lot of javascript samples, both with/without libraries, jQuery to mention one. As an old JavaScript developer, I learned early to make use of unobtrusive javascript where ...
3
votes
2answers
96 views

Attaching Events to Document Better Than Attaching Them to Elements?

While bouncing around StackOverflow, I've noticed a number of people attaching events (notably click events) to the document as opposed to the elements themselves. Example: Given this: <button ...
7
votes
6answers
1k views

Triggering custom events in AJAX callbacks

I'm pretty new to JavaScript, but one of the things that's been frustrating is that our AJAX callbacks have been getting packed with different functionality, making it difficult to keep everything ...