Skip to content

Instantly share code, notes, and snippets.

@kmgdevelopment
Created July 3, 2012 21:59
Show Gist options
  • Save kmgdevelopment/3043638 to your computer and use it in GitHub Desktop.
Save kmgdevelopment/3043638 to your computer and use it in GitHub Desktop.
Ajax Pagination
$('#pager a').click(function(e){
e.preventDefault();
var theUrl = $this.attr('href');
$.ajax({
url: theUrl,
success: function(data){
var results = $(data);
var finalResults = results.filter('#preResults').html();
var pagerResults = results.filter('#pager').html();
$('#results').replaceWith(finalResults);
$('#pagerCatch').html(pagerResults);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment