Posts (1) in June 2014:

Taming DOM Events - A better way to listen for JavaScript events

06/05/2014
How much time have you spent trying to find specific event listeners in your code? Some frameworks such as AngularJS and Ember.js have specific locations where listeners are created, usually in the framework’s controller layer. Others such as jQuery and Backbone.js let developers manage events but don’t really care where the event listeners are created. At Craftsy we used to just put event listeners in the HTML or a relevant JavaScript file already on the page. This structure - or lack thereof - led to quite a bit of wasted time; at one point I spent close to half an hour locating a specific piece of code for the “Add to Cart” button on our class pages. Read more