的处理: // 当应用以动态方式加载内容并更新地址栏中的网址时,也应该更新通过 gtag.js 存储的网页网址。 // https://developers.google.cn/analytics/devguides/collection/gtagjs/single-page-applications?hl=zh-cn $('.nav-main').find('.list-v').not('.menu-phone').removeAttr("style",""); // 移除小尾巴的移除 $('.menu-phone.list-v').removeAttr("style",""); // 移除小尾巴的移除 $('script[data-pjax], .pjax-reload script').each(function () { $(this).parent().append($(this).remove()); }); try{ pjax_fancybox(); if ('.cover') { $('.cover').backstretch("resize"); } else { $.backstretch("resize"); } pjax_initCopyCode(); pjax_gitalk(); } catch (e) { console.log(e); } window.HideLoading(); }); document.addEventListener('pjax:error', function (e) { window.HideLoading(); window.location.href = e.triggerElement.href; });