Pronto

A jQuery plugin for faster page loads.

Current Version: 3.1.0


Documentation

Installation

Include the following resources on your page before initializing:

<script src="jquery.fs.pronto.js"></script>

Bower

You can deploy and update via the command line with Bower:

bower install Pronto

Options

Options are set by passing a valid options object at initialization or to the public "defaults" method. You can also set custom options for a specific instance by attaching a data-boxer-options attribute containing a properly formatted JSON object to the target element.

Name Type Default Description
cache boolean true Cache AJAX responses
force boolean false Forces new requests when navigating back/forward
jump boolean false Jump page to top on render
modal boolean false Flag for content loaded into modal
selecter string 'a' Selecter to target in the DOM
render function $.noop Custom render function
requestKey string 'pronto' GET variable for requests
target object { title: 'title', content: '#pronto' } Key / value pair for rendering responses (key is response key, value is target selector)
tracking.legacy boolean false Flag for legacy Google Analytics tracking
tracking.manager boolean false Flag for Tag Manager tracking
tracking.variable string 'currentURL' Tag Manager dataLayer variable name (macro in Tag Manager)
tracking.event string 'PageView' Tag Manager event name (rule in Tag Manager)

Events

Events are triggered on the target instance's element, unless otherwise stated.

Option Description
pronto.request Before request is made; triggered on window
pronto.progress As request is loaded; triggered on window
pronto.load After request is loaded; triggered on window
pronto.render After state is rendered; triggered on window
pronto.error After load error; triggered on window

Methods

Methods are publicly available to all active instances, unless otherwise stated.

defaults

Sets default plugin options

$.pronto("defaults", opts);
Parameter Type Default Description
opts object {} Options object

disable

Disable Pronto

$.pronto("enable");

enable

Enables Pronto

$.pronto("enable");

load

Loads new page

$.pronto("load", "http://website.com/page/");
Parameter Type Default Description
opts url '' URL to load