Skip to content

0b10011/limberjax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

limberjax

Build Status NPM version JavaScript Style Guide

limberjax is a jQuery plugin that adds support for partial page loads with ajax while fully supporting URLs with pushState.

Warning: limberjax is not quite ready for production. Some things are still broken/untested (eg, 404/500 errors), and this code will change/break quite a bit before release.

limberjax intercepts link clicks and form submits, submits them to your server via ajax, parses the response, and replaces the appropriate parts of the existing page with the new content.

Benefits:

  • Client only has to download, parse, and process/execute CSS and JavaScript once
  • Server can render only what's needed for the request (eg, skip layout render)

Quickstart

This will let you immediately see the majority of the benefits of limberjax on the client without making more in-depth changes on the server yet.

  1. Save limberjax.js to your project (minify/uglify to your liking)
  2. Add new jQuery.Limberjax("#your-content-wrapper"); to your code
  3. On the server, return HTTP response code 412 Precondition Failed if the limberjax query parameter's value does not equal the version on the server (this is your code's version, not limberjax's; a git commit id works well)

Notes

  • Character encoding should be set with <meta charset="ENCODING"> on initial page load and all documents that will be requested with limberjax must use the same encoding
  • External scripts will only be loaded once per unique src + type combination
  • External stylesheets will only be loaded once per unique href + media combination

About

limberjax is a jQuery plugin that adds support for partial page loads with ajax while fully supporting URLs with `pushState`.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published