Is pjax the way to go for "fluid" navigation?
Asked Answered
E

5

36

I've started playing with pjax, as I want to provide a fast, fluid experience for my users without a lot of unnecessary HTTP requests and repeated rendering of unchanged HTML.

I have it working fairly well on my site, and I must say it was surprisingly easy to get up and running, considering how much a difference it makes for the experience.

However, I'm seeing very little support for pjax -- both on StackOverflow, and on the web in general (a google search returns many results at the top totally unrelated to web development).

But as impressed I am with it, even if it's not widely supported yet, I may still use it. My main concern is running into big problems later when I've already invested my code in it without a lot of support. So I wanted to make sure there wasn't something else out there.

Are there alternatives for implementing the same functionality that pjax provides that I'm not aware of? Or is it so new that not many people know about it yet? Or, is it just a bad/problematic implementation?

Elegancy answered 27/5, 2011 at 5:16 Comment(1)
with firefox 3.6.17 I get the message, 'Sorry, your browser doesn't support pjax :(' & reading the one discussion of pjax in SO, IE perhaps doesn't support it either.Daniels
S
8

http://caniuse.com/#search=history will give you an indication of what supports the current version of pjax.

The severside code that sniffs the request for PJAX header could also react to the browser and degrade nicely for other browsers.

http://forum.kohanaframework.org/discussion/8869/kopjax-simplistic-pjax-jquery-ajax-module/p1#Comment_60090 is a decent list of alternate options.

If you don't mind missing support for other browsers or make changes to do so then PJAX's only draw back I can see is the need to have 1 chunk/partial to update.

Sello answered 1/6, 2011 at 12:2 Comment(1)
"The severside code that sniffs the request for PJAX header could also react to the browser and degrade nicely for other browsers." — Why would you need to do this? The PJAX header is only sent on PJAX requests, which only occur if the browser supports PJAX.Luting
T
4

I was running into issues trying to work around the 1 container partial update limitation, so I put together a simple alternative that degrades gracefully. djax achieves the same result as pjax, except it is indifferent to layout changes between pages, and allows you to update as many partials on the page as you like.

Tocantins answered 23/2, 2012 at 21:25 Comment(0)
C
2

I'm with Jerad - based on using the demo in IE, it appears to degrade gracefully.

If you can live with some users not getting the AJAX experience, I don't see anything to lose.

Coble answered 2/6, 2011 at 1:18 Comment(0)
I
1

I'm also getting "Sorry, not supported" messages.

Judging by the browser support issues pointed out here, I would say that while pjax sounds interesting, it probably isn't ready for the prime-time yet.

It doesn't work in Firefox 3.6, but that's a minor issue as FF4 is now available. But for the foreseeable future, your really big blocker is IE. If the product isn't even supported by IE9, then you're really not doing yourself any favours by using it.

But with the rate of change in the browser world at the moment, this will improve, so feel free to experiment with it with a view to implementing it at a later date -- I wouldn't be suprised if this answer is completely different in a year's time -- But for the time being I'd say that's all it is: an experimental curiosity.

Ingratiate answered 1/6, 2011 at 12:14 Comment(1)
Thanks. I actually was aware of the lack of support for IE. My thinking is worst case, users using IE will have the same experience as they would if I didn't use pjax. All other users (FF4, Chrome, Safari) will have a much more fluid experience.Elegancy
C
0

Pjax is a great solution and it degrades gracefully. If you want a more in-depth solution you can use backbone-rails but it's a bit more work. I believe it is more compatible with older browsers as it does not depend on push state...

Crystalcrystalline answered 17/11, 2011 at 6:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.