Switch between pages smoothly with AJAX.
Warning : PHP is required to try the demo website.
<script src="js/vanilla-pjax.js"></script>
For this exemple, we will use the .main-content
container
In your code, hide everything around the .main-content
container, including its HTML tags if the URL contains the parameter is_ajax=1.
new vanillaPJAX({
targetContainer: document.body.querySelector('.main-content'),
ajaxParam: 'is_ajax'
});
- useSessionStorage : Cache page content in Session storage.
- useLocalStorage : Cache page content in Local storage.
- If a session/local storage setting is enabled, links will be preloaded on mouseover.