Skip to content

Instantly share code, notes, and snippets.

@moro
Created June 14, 2011 10:05
Show Gist options
  • Save moro/1024620 to your computer and use it in GitHub Desktop.
Save moro/1024620 to your computer and use it in GitHub Desktop.
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