diff --git a/example/example.js b/example/example.js index 9441179..f52f8bf 100644 --- a/example/example.js +++ b/example/example.js @@ -19,7 +19,8 @@ document.addEventListener("pjax:success", function() { document.addEventListener("DOMContentLoaded", function() { var pjax = new Pjax({ - selectors: [".body"], + elements: [".js-Pjax"], + selectors: [".body"] // currentUrlFullReload: true, }) console.log("Pjax initialized.", pjax) diff --git a/example/index.html b/example/index.html index 8e259b9..cc95a19 100644 --- a/example/index.html +++ b/example/index.html @@ -10,7 +10,7 @@

Index

Hello. - Go to Page 2 and view your console to see Pjax events. + Go to Page 2 and view your console to see Pjax events. Clicking on this page will just reload the page entierly.
diff --git a/example/page2.html b/example/page2.html index b997abb..36d2e33 100644 --- a/example/page2.html +++ b/example/page2.html @@ -9,7 +9,7 @@

Page 2

- Hello. Go to Index. + Hello. Go to Index.
diff --git a/index.js b/index.js index b7f7b3b..bd7bc56 100644 --- a/index.js +++ b/index.js @@ -83,6 +83,7 @@ Pjax.prototype = { }, onSwitch: function() { + this.parseDOM(document) trigger(window, "resize scroll") },