a minimal pjax implementation, optimized for understandability
JavaScript Ruby
Switch branches/tags
Nothing to show
Latest commit 4ae2873 Aug 21, 2011 @neall working simple example
Failed to load latest commit information.
Gemfile initial commit Aug 18, 2011
README.markdown working simple example Aug 21, 2011
app.rb working simple example Aug 21, 2011
config.ru working simple example Aug 21, 2011


simpler pjax

Right now this code is too simple to be useful, except to show how the pjax technique works. For instance, it doesn't even check weather history.pushState is supported. For a more complete library, check out Chris Wanstrath's jquery-pjax library.

That said, if you're looking to understand how pjax works just take a look at public/pjaxify.js. At just 23 non-golfed lines of code, plus some comments, it's hopefully easier to follow. I think the pjax technique works best when you customize it to the needs of your site. Here I send a title and some markup down the wire in JSON, but you could easily imagine sending multiple blocks of markup (for different sections of the page) and handling the transitions more gracefully (like having a "loading" spinner).