Search Wiki:
Resource Page Description
Why wait until domReady to attach your events?

No more pages hanging out, partially rendered with no events attached to them! If the target element of your event will be rendered on the initial page load, there is no need to wait for domReady to attach an event to it. Use 'Live and Let Die' -.lald()- to attach your handler.

If you are using a plugin that waits until domReady to attach its own events, by using 'Live and Die' (in LA) -.lad()- you can take action for the period of time the DOM is loading to provide some sort of user feedback until the other plugin has finished.

Use standard event binding and live binding together.
Bind your events using lald(). While the DOM is loading, live() is used. At domReady, die() is applied to the live() event and then your event is attached to the same element using bind(). The best of both worlds.

Also contains live and die (in LA) that binds your events with live() and then uses die() on domReady without reattaching them with bind(). Helpful when using other libraries that don't attach until domReady.

jQuery plugin
live die domReady

Uses the same basic syntax as .bind() and .live()

Live and Let Die: .lald( eventType, eventData , handler(eventObject) )
Live and Die: .lad( eventType, eventData , handler(eventObject) )

Note: To be of any use, this really needs to be used in the <head> section of your page

Sir Paul
Wang Chung

0.3 update is for compat with jQuery 1.6.x
Last edited Aug 4 2011 at 9:35 PM  by geoffreyk00, version 15
Page view tracker