Files
pjax/example/example.js

29 lines
749 B
JavaScript
Raw Normal View History

2015-11-13 10:43:22 +11:00
/* global Pjax */
console.log("Document initialized:", window.location.href)
2015-11-13 10:40:59 +11:00
2015-11-13 10:43:22 +11:00
document.addEventListener("pjax:send", function() {
console.log("Event: pjax:send", arguments)
2015-11-13 10:40:59 +11:00
})
2015-11-13 10:43:22 +11:00
document.addEventListener("pjax:complete", function() {
console.log("Event: pjax:complete", arguments)
2015-11-13 10:40:59 +11:00
})
2015-11-13 10:43:22 +11:00
document.addEventListener("pjax:error", function() {
console.log("Event: pjax:error", arguments)
2015-11-13 10:40:59 +11:00
})
2015-11-13 10:43:22 +11:00
document.addEventListener("pjax:success", function() {
console.log("Event: pjax:success", arguments)
2015-11-13 10:40:59 +11:00
})
2015-11-13 10:43:22 +11:00
document.addEventListener("DOMContentLoaded", function() {
2015-11-13 10:40:59 +11:00
var pjax = new Pjax({
elements: [".js-Pjax"],
2018-02-21 18:27:50 +00:00
selectors: [".body", "title"],
cacheBust: true,
// currentUrlFullReload: true,
2015-11-13 10:40:59 +11:00
})
2015-11-13 10:43:22 +11:00
console.log("Pjax initialized.", pjax)
2015-11-13 10:40:59 +11:00
})