Live Query plugin for jquery
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');
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
thanks diyism I will take a look on Jquery live bind.
admin
13 Nov 08 at 11:54 am
[...] New release contains new selector engine called Sizzle (the fastest css selector) and live events (which work similar to the live query plugin. [...]
MyFunnyDev » Blog Archive » JQuery 1.3
15 Jan 09 at 8:51 pm