MyFunnyDev

web, coding and beyond

Live Query plugin for jquery

with 3 comments

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');

Written by MichaƂ Kuklis

December 16th, 2007 at 2:12 pm

Posted in Javascript, jquery

Tagged with

3 Responses to 'Live Query plugin for jquery'

Subscribe to comments with RSS or TrackBack to 'Live Query plugin for jquery'.

  1. 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

    diyism

    12 Nov 08 at 6:52 pm

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

    admin

    13 Nov 08 at 11:54 am

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

Leave a Reply