Vince Scordino Team : Web Development Tags : Web Development

Let’s go .live() with jQuery

Vince Scordino Team : Web Development Tags : Web Development

So your client has requested some wacky jQuery to jazz up their feature page, and, well, there’s already a decent amount of JavaScript that isn’t really agreeing with Internet Explorer’s rendering engine right? In comes jQuery .live() to the rescue!

Ok, stay with me here. Instead of having all click events bound to the DOM as we generally do with jQuery, we can now bind a handler using the .live() method. 

What this means is, if we have 1000’s of selectors, only 1 event is bound to the DOM, not 1000’s. Since the handler is only called once the trigger is made, elements can be added at any time. Thanks jQuery, another impressive addition to accompany the wonderful world of AJAX.

For more information, visit: http://api.jquery.com/live/