Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A jQuery plugin that prefetches pages and will improve your app's performance and speed.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
README.md
jquery-1.7.2.min.js
prefetchr.js

README.md

fetchr

A jQuery plugin that will prefetch pages and improve performance of single-page apps and apps that depend heavily on AJAX.

Steps

1) Add "data-prefetch" to any link that you wish to pre-fetch.

<a href="login.html" data-prefetch>Login</a>

2) Subscribe to "fetched" event, and do what you wish after the user clicks a link. You can slide the page in, replace the body with it, or do whatever you want!

$.subscribe('fetched', function(event, response){
   // Do whatever you want!
   // response is a raw HTML string of the page you fetched
});

Benefits

  • Load pages up front, so users don't have to wait after clicking. This is useful for links that are most likely to be clicked.
  • Improve perceived loading time.

License

MIT

Something went wrong with that request. Please try again.