finds.dev← search

// the find

defunkt/jquery-pjax

★ 16,649 · JavaScript · MIT · updated Nov 2022

pushState + ajax = pjax

jquery-pjax is a jQuery plugin that intercepts link clicks, fetches the target page via XHR, swaps a container element, and updates the URL with pushState — giving you SPA-like navigation without a full page reload. It was created at GitHub and saw wide use in the Rails/jQuery era. The README explicitly states the project is unmaintained and feature-frozen.

The core idea is sound and the implementation is simple enough to read in one sitting — just jquery.pjax.js, no build complexity. The event system is thorough: you get distinct events for click, send, beforeReplace, success, timeout, error, and popstate, which is enough surface area to hook in loading indicators, analytics, or plugin reinitialization without patching internals. The version negotiation via X-PJAX-Version header is a practical touch — deploy a new asset hash and clients automatically do a hard reload on next navigation. Fallback behavior is sane: timeouts and errors hard-refresh rather than silently failing.

It's dead. Last real activity was 2022 and the README says so upfront — if you hit a bug you're patching it yourself. It requires jQuery, which is a significant dependency to carry in 2024 just for navigation. The mental model breaks down with third-party scripts that attach to DOMContentLoaded or window.load — you get to track down every plugin and re-init it on pjax:end, which compounds over time. Modern alternatives (Turbo, htmx) solve the same problem without the jQuery dependency and are actively maintained; there's no reason to start a new project with pjax.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →