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
<section>
tag in it? Is your server returning chrome-less content when theX-PJAX
header or the_pjax
search param are sent? Can you link to a demo url? – Telluric$(function() { $('ul a').pjax("#main", { fragment: "#main" }); });
. Or place the call at the bottom of the page. – Telluric