Live Query Plugin: Solution of your problems in jQuery
Some one asked me about the solution of binding events to dynamically generated elements. And one name came in my mind that is LiveQuery. If you have used jQuery very well and worked on some dynamic created content using jQuery Ajax, then you must faced links binding problem to these new elements.
For example:
If you are performing some delete action on click of any element using its ID.
$('a#someID').click(function(){ // your code }); // or something like $('a#someID').mouseenter(function(){ // your code }); // or something like $('a#someID').focus(function(){ // your code });
And if there are some dynamically generated links that also hold id “someID” then they won’t work. To get the solution of this problem, Brandon Aaron (jQuery team member) developed a plugin called LiveQuery plugin which binds the events to these dynamically generated elements.
Now if you have some dynamically generated elements. Use your event like this:
$('a#someID').livequery('click', function(e) { // your code }); // or something like $('a#someID').livequery('mouseenter', function(e) { // your code }); // or something like $('a#someID').livequery('focus', function(e) { // your code });
I have used this plugin in my zGrid development
Who I Am

Zeeshan Rasool
Software Engineer - PHP
Lahore - Pakistan
zeeshan(@)99points.info
Skype: zeeshan-rasool
gTalk: zishan.rasool85
Categories
- AJAX (37)
- Codeigniter (16)
- CSS (16)
- Facebook (11)
- Joomla (1)
- JQuery (53)
- Miscellaneous (4)
- Mootools (1)
- MySQL (6)
- PHP (60)
- SEO (2)
- Technology (6)
- Tutorials (15)
- Twitter (2)
- Web Design (23)
- Web Development (57)
- WordPress (2)
Tags
Comments
- ZeeShaN on Facebook Wall Script Clone with JQuery and PHP: Personal Project BETA Version 2.0
- 20 + Fresh jQuery Image Gallery/Slider Plugins and Tutorials Worth a Look | free on JQuery Based Flipped Image Gallery with Bounce Effects
- 20 + Fresh jQuery Image Gallery/Slider Plugins and Tutorials Worth a Look | free on Fresh JQuery Image Gallery with Captions and Auto Play/Pause Rotation
- 25 Cool and Helpful jQuery Plugins/Tutorials For Your Next Project | free on jQuery Tutorial: Create jQuery and CSS based Awesome navigation.
- 25 Cool and Helpful jQuery Plugins/Tutorials For Your Next Project | free on Ajax Tutorial: How to Create Ajax Search Using PHP jQuery and MYSQL
ZeeShaN





