Asynchronous switch functions (Make sure the DOM is parsed after switching) (#79)
* Make sure the DOM is parsed after switching * Fix reload-link in the example
This commit was merged in pull request #79.
This commit is contained in:
1 parent
1e40a0d70b
commit
be5d58d550
4 files changed
+5
-3
No files matched your search
+2
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
<div class='body'>
|
||||
<h1>Index</h1>
|
||||
Hello.
|
||||
Go to <a href='page2.html'>Page 2</a> and view your console to see Pjax events.
|
||||
Go to <a href='page2.html' class="js-Pjax">Page 2</a> and view your console to see Pjax events.
|
||||
Clicking on <a href='index.html'>this page</a> will just reload the page entierly.
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<div class='body'>
|
||||
<h1>Page 2</h1>
|
||||
Hello. Go to <a href='index.html'>Index</a>.
|
||||
Hello. Go to <a href='index.html' class="js-Pjax">Index</a>.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user