Skip to content

Commit a704679

Browse files
committed
Failing pjax
1 parent 426361a commit a704679

File tree

2 files changed

+620
-1
lines changed

2 files changed

+620
-1
lines changed

featherbb/View/header.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@
3232
<link rel="shortcut icon" href="<?= Url::base_static() ?>/style/img/favicon.ico" />
3333
<!-- Theme -->
3434
<link rel="stylesheet" type="text/css" href="<?= Url::base_static() ?>/style/themes/<?= $style ?>/style.css">
35+
<script type="text/javascript" src="style/imports/pjax-standalone.js"></script>
36+
<script type='text/javascript'>
37+
// Ensure console is defined
38+
if(typeof console === 'undefined') console = {"log":function(m){}};
39+
// PJAX links!
40+
pjax.connect({
41+
'container': 'container',
42+
'success': function(event){
43+
var url = (typeof event.data !== 'undefined') ? event.data.url : '';
44+
console.log("Successfully loaded "+ url);
45+
},
46+
'error': function(event){
47+
var url = (typeof event.data !== 'undefined') ? event.data.url : '';
48+
console.log("Could not load "+ url);
49+
},
50+
'ready': function(){
51+
console.log("PJAX loaded!");
52+
}
53+
});
54+
// pjax.connect('content', 'pjaxer');
55+
// pjax.connect('content');
56+
// pjax.connect();
57+
</script>
3558
<?php
3659

3760
foreach($assets as $type => $items) {
@@ -167,7 +190,7 @@ function process_form(the_form)
167190
</div>
168191
</nav>
169192

170-
<div class="container">
193+
<div class="container" id="container">
171194
<div class="container-title-status">
172195
<h1 class="title-site">
173196
<a href="<?= Url::base() ?>" title="" class="site-name">

0 commit comments

Comments
 (0)