Skip to content

Instantly share code, notes, and snippets.

@moro
Created June 14, 2011 10:05
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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