Jquery .on not working corectly
Im playing around with pagination and jquery, my code first looked like this:
$(function() {
$(".pagination a").live("click", function(){
$.get(this.href, null, null, "script");
return false;
});
});
Then i noticed that live is not supported in jquery 1.9 so i changed my code:
$(function() {
$(".pagination").on("click", 'a', function(){
$.get(this.href, null, null, "script");
return false;
});
});
But somehow this also wont work! The problem is that can navigate from the
first ajax page to the second but then form the second back to the first
page or to the third page my ajax is not working. I supose because my code
does not regognice the new added .pagination a!
No comments:
Post a Comment