MyFunnyDev

web, coding and beyond

Archive for December, 2007

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