Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kaminari and pushState
(function($){
$('.pagination a[data-remote=true]').live('ajax:success', function(e){ window.history.pushState('', '', $(e.target).attr('href')) })
$(window).bind('popstate', function(){ $.ajax({url:window.location, dataType:'script'}) ; return true });
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment