Files
pjax/example/example.js

27 lines
656 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({
2015-11-13 10:43:22 +11:00
selectors: [".body"]
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
})