Search code examples
javascriptjqueryliveready

jQuery difference between live() and ready()?


What is the exact difference between live() and ready()?


Edit: found that die() is the opposite of live()


Solution

  • .ready() lets you register a callback that fires when the DOM is ready - this is similar to using window.onload but fires earlier (and you can register more than one callback).

    .live() lets you register a callback to a range of events based on a selector, which continually monitors the DOM and will register itself to new nodes that are added.