I have a very sketchy idea of how pjax works and therefore a very sketchy implementation of it on my site. I have this code at the beginning of all my jquery
$('li a').pjax('#container');
and the thing that you would click looks like this
<li><a href="main.html"><div id="sortmain" class="catagories">main</div></a></li>
so when I click that li
it loads the main.html into the container div. But it is glitchy and pretty slow. How can I improve this? Also, because main.html is a real document when I refresh the page it only shows what main.html outputs, how do I fix that?
I can't tell why it is slow or glitchy without looking at your site.
If you want main.html
to be a full-page (so that refresh works without server-side processing) you can use the fragment option in pjax:
$('li a').pjax("#container", { fragment: "#container" });
This will update the #container
div with PJAX (if pushState is available) and on older browsers your site will just work the way it used to.