How to use PJAX? (PJAX With PHP?)
Posted
by
user1302430
on Stack Overflow
See other posts from Stack Overflow
or by user1302430
Published on 2012-04-04T01:08:10Z
Indexed on
2012/06/22
3:16 UTC
Read the original article
Hit count: 931
I was trying to get PJAX working with my PHP site, this is the code I am using for it:
<script src="js/jquery.js"></script>
<script src="js/jquery.pjax.js"></script>
<script type="text/javascript">
$(function(){
// pjax
$('ul a').pjax('section')
})
</script>
I am just using the code they used on the PJAX demo page, but replacing the container they used (#main) with the one for my site, which was the section tag. There are no errors on the console or on the page, but it doesn't work either! Before I was using
$(function() {
$('ul a').pjax('section')
});
and
$('document').ready(function(){
$('ul a').pjax('section')
});
But when I don't use either of those and just use $('ul a').pjax('section') I see this error in the console:
Uncaught no pjax container for section in jquery.pjax.js (line: 353)
Could I get some help with this? Thanks
© Stack Overflow or respective owner