When your browser freezes on you on some random web page, there's a pretty good chance its caused by the very JavaScript designed to improve your experience.
Good 'ole JavaScript performance. Sebastian Ruiz of Atlassian recently worked on a UI rewrite of two of their products (FishEye and Crucible) and found some interesting solutions to problems that came up:
The event binder
A simple jQuery event bind selector might look like this:
This is a rather standard method of binding functions to events with jQuery. It's easy and it's elegant. When the html document has finished loading, the anonymous function is executed. This will find all elements which have the class 'alert-on-click' in the document, and binds a function which is triggered on a click event.
Slow class selectors
This method can be problematic with large html documents with thousands of DOM ele