Skip to content

Instantly share code, notes, and snippets.

@jonathanpenn
Created March 3, 2009 17:28
Show Gist options
  • Save jonathanpenn/73411 to your computer and use it in GitHub Desktop.
Save jonathanpenn/73411 to your computer and use it in GitHub Desktop.
Some ideas for unobtrusive ajax pagination.
HTML Markup...
<div class="pagination_container">
<div class="pagination>
<a href="...">1</a>...
</div>
<div class="pagination_target">
<p>Blah, blah</p>
...
</div>
</div>
jQuery Behavior
$(".pagination_container .pagination a").live("click", function(click_event) {
click_event.preventDefault();
var target = $(this).closest(".pagination_container").find(".pagination_target");
var href = $(this).attr("href");
target.load(href);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment