hexo-theme-keep/layout/_partial/pjax/pjax.ejs

26 lines
701 B
Plaintext
Raw Normal View History

<%- __js('js/libs/pjax.min.js') %>
<script>
window.addEventListener('DOMContentLoaded', () => {
const pjax = new Pjax({
selectors: [
'head title',
'.page-container',
'.pjax',
],
2020-12-31 16:38:31 +08:00
history: true,
cacheBust: false,
currentUrlFullReload: false,
2020-12-31 16:38:31 +08:00
timeout: 0,
scrollTo: false,
scrollRestoration: false,
debug: false,
});
window.addEventListener('pjax:complete', () => {
KEEP.refresh();
pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
});
});
</script>