PJAX-Standalone

Pjax-Standalone is a standalone implementation of defunkt's original jQuery-PJAX plugin. With no external dependencies, PJAX-Standalone can be dropped into and used on any website, regardless of the JavaScript frameworks in use.

About

PJAX Standalone is easy to set up and get working with both new and existing websites. Adding the PJAX-Standalone JavaScript to the head of your website and calling pjax.connect("id_of_container"); is all thats needed to get it working.

By default PJAX-Standalone uses it's "smartload" feature in order to work with existing with pages with no server side support for PJAX. If your server side code is configured to work with PJAX (thus only returning the content needed for rendering) this feature can be disabled for even more performance gains.

Is PJAX-Standlone worth having on my site?
PJAX provides the most benefit if your website design comprises primarily of one main content area, surrounded by a wrapper (header, footer, aside) that rarely change. Since PJAX only ever has to reload the main container area's content, assets such as CSS, JavaScript, images and others will only be loaded once.

How customizable is PJAX-Standalone
PJAX-Standalone fires a number of events, which can be used to extend its native functionality. Additionally a number of additional options can be specified in the connect method, in order to further configure how PJAX-Standalone functions. Documentation on the events and options available in PJAX can be seen in the github readme.

What is PJAX

PJAX (Push-state AJAX) is a performance optimization, allowing users to browse websites without the overhead of reloading assets such as CSS & images each time a web page is loaded.

PJAX works by using AJAX to "load" pages on behalf of the user, then dynamically swapping the contents of the "container" for the newly loaded content from the link the user clicked. Unlike older AJAX solution's PJAX fully preserves permalinks and back button functionality. Using progressive enhancement, PJAX will seamlessly fall back to loading pages in the normal way in older browsers, while newer browsers can make use of the improved performance.

Loaded at:
Thursday 21st of November 2024 01:12:45 AM

Get the Source

PJAX-Standalone is licensed under the MIT License.

Install with bower:

bower install pjax-standalone


Full documentation for using PJAX-Standalone can be found in the github readme file.