Namespace: pjax

db.libs.pjax

Load partial content using AJAX

Source:

Methods

(static) init(idopt) → {array}

Initialize the component

Parameters:
Name Type Attributes Description
id external:jQuery | string <optional>
Selector or jQuery element. Default to all link elements with the data-pjax attribute
Source:
Returns:
Returns array of all targeted elements
Type
array

(static) load(id, optionsopt) → {external:jQuery}

Load data from a url and append or prepend to a element.

Parameters:
Name Type Attributes Description
id external:jQuery | string Selector or jQuery element
options object <optional>
Options can be passed to load or read from the data-options attribute on the element
Properties
Name Type Attributes Default Description
url string <optional>
Url to load
selector string <optional>
The element to update
insert string <optional>
append Append or prepend the the content
text string <optional>
initial The text the link recives after the xhr is done loading. Defaults to the initial
loader boolean <optional>
false Replace the link content with a loader while the xhr loads
pushState boolean <optional>
false Update pushState with the link href
remove boolean <optional>
false Remove the link when the xhr is complete and a success
Source:
Returns:
jQuery element
Type
external:jQuery