Introduction
Pjax is a technique that allows you to progressively enhance normal links on a page so that clicks result in the linked content being loaded via Ajax and the URL being updated using HTML5 `pushState`, avoiding a full page load. In browsers that don't support `pushState` or that have JavaScript disabled, link clicks will result in a normal full page load. The Pjax Utility makes it easy to add this functionality to existing pages.
It's easy to add pjax functionality to any page with just a few lines of code. You don't even need any special server-side logic. To include the source files for Pjax and its dependencies, first load the YUI seed file if you haven't already loaded it. Next, create a new YUI instance for your application and populate it with the modules you need by specifying them as arguments to the `YUI().use()` method.
This creates a new Pjax instance that, by default, listens for clicks on any link on the page that has a `yui3-pjax` class. When a `yui3-pjax` link is clicked, its URL will be loaded via Ajax and the loaded content will be inserted into the `#content` div, replacing its existing contents. If the loaded page includes an HTML `<title>` element, the current page's title will also be replaced with the new title.
One important thing to note is that since Pjax uses `XMLHttpRequest` under the hood, it can only load URLs from the same origin as the current page. This means the link URL must share the same protocol, port, and host as the current page. Pjax will ignore URLs it can't load, resulting in a full page load for those URLs.
Ajax navigationHTML5 pushStateYUI utilityNode pluginSame-origin URLsLink enhancementContent replacement
Screenshots

Deployment
YUI Pjax 插件(pjax-plugin)
适用于希望把 Pjax 直接挂载到某个内容容器 Node 上、由该容器自动接管并替换内容的页面。
YUI Pjax 类实例(pjax)
适用于需要以独立 Y.Pjax 实例方式配置 container、选择器、路由和事件等行为的页面或应用。
Details
Type Open-source software
License BSD-3-Clause
Last verified 2026-07-18
Ad slot 300 × 250 Ad
About the data
Stars / commit times sync automatically from the GitHub API; pricing and features are human-verified.