I have this piece of jQuery code in my page, which basically does some stuff to the <td>
in the table based on the server response.
$('document').ready(function() {
$('td a').click(function(e) {
e.preventDefault()
var href = $(this).attr('href');
$.ajax({
url: href,
success: function() {
[...] // SKIPPED, DO STUFF HERE.
},
}
);
})
})
It works pretty well.... Except one problem. It would only work on the <td>
entries that were loaded initially.
If I use an endless pagination (like google images style, or twitter style), where more entries are loaded after some AJAX actions (such as button clicks, scrolling to the bottom, etc), those newly-loaded entries wouldn't work with the dollar sign functions.
What can I do to make it work with all <td>
entries?