Created
July 3, 2012 21:59
-
-
Save kmgdevelopment/3043638 to your computer and use it in GitHub Desktop.
Ajax Pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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