Setup

Pager.js depends on KnockoutJS and jQuery. Include either pager.js or pager.min.js. Choose between a naïve history manager (pager.start([id: String])), a history manager based on jQuery hashchange (pager.start([id: String])), a history manager based on History.js (pager.startHistoryJs([id: String])) or write your own.

Naïve history manager

// extend your view-model with pager.js specific data
pager.extendWithPage(viewModel);
// apply the view-model using KnockoutJS as normal
ko.applyBindings(viewModel);
// start pager.js
pager.start();
    

jQuery Hashchange as history manager

Is the same as the naïve, but you need to include the jQuery hashchange plugin first.
// use #!/ instead of the default #
pager.Href.hash = '#!/';
// extend your view-model with pager.js specific data
pager.extendWithPage(viewModel);
// apply the view-model using KnockoutJS as normal
ko.applyBindings(viewModel);
// start pager.js
pager.start();
    

History.js as history manager

// Set in the head element
<base href="http://some/url/"/>


// use HTML5 history
pager.useHTML5history = true;
// use History instead of history
pager.Href5.history = History;
// extend your view-model with pager.js specific data
pager.extendWithPage(viewModel);
// apply the view-model using KnockoutJS as normal
ko.applyBindings(viewModel);
// start pager.js
pager.startHistoryJs();