Live Query plugin for jquery

by MichaƂ Kuklis on 16/12/2007

It’s annoying to rebind events to their targets after Ajax request. You can read more about it here.

In order to fix it you can use Live Query plugin.

Instead of doing:

$('a').click(dosomething);
$('#htmlElement').load('server.php',function() {
  $('a').click(dosomething);
});

you can now do:

$('a').livequery('click',dosomething);
$('#htmlElement').load('server.php');

There are 3 comments in this article:

  1. 12/11/2008diyism says:

    Why not give a try to “jQuery live bind”?

    You even could use it like this(bind an element before create it):
    $.live_bind(“.kkkk .ppp[title='333']:nth-child(3)”, ‘click’, alr1);
    $(‘.kkkk’).append(‘<div class=”ppp” title=”333″>hello</div>’);

    http://plugins.jquery.com/project/live_bind

  2. 13/11/2008admin says:

    thanks diyism I will take a look on Jquery live bind.

  3. 15/01/2009MyFunnyDev » Blog Archive » JQuery 1.3 says:

    [...] New release contains new selector engine called Sizzle (the fastest css selector) and live events (which work similar to the live query plugin. [...]

Write a comment: