Typecho pjax(InstantClick)常用的重载函数 - 夏目友人帐

Typecho pjax(InstantClick)常用的重载函数

"夏目贵志" 发表于: 2018年04月06日

pjax(InstantClick)一般需要重载的函数,希望这篇文章能让大家少浪费点时间

多说评论

if (typeof DUOSHUO !== 'undefined'){
DUOSHUO.EmbedThread('.ds-thread');} /

网易云跟贴

if (typeof Tie !== 'undefined') {
                        Tie.loader("", true);
            }

畅言(代码来自http://www.neurallinker.com/94.misaka)

if($("#SOHUCS").length==1){
window.changyan = undefined;window.cyan = undefined;
$.getScript("https://changyan.sohu.com/upload/changyan.js", function(){window.changyan.api.config({appid: "你的appid参数",conf: "你的conf参数"});});
}

百度统计

 if (typeof _hmt !== 'undefined'){
      _hmt.push(['_trackPageview', location.pathname + location.search]);
}

谷歌统计

if (typeof ga !== 'undefined'){
        ga('send', 'pageview', location.pathname + location.search);
}

piwik统计

 _paq.push(['setDocumentTitle', document.title]);
    _paq.push(['trackPageView']);

SynatxHighlighter

 SyntaxHighlighter.highlight();

google code prettify

   if (typeof prettyPrint !== 'undefined'){
      prettyPrint();
}

MathJax

if (isInitialLoad === false) {
    if (typeof MathJax !== 'undefined'){
      MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}

Prism.js语法高亮

 if (typeof Prism !== 'undefined') {
Prism.highlightAll(true,null);}

转载自:https://qqdie.com/archives/pjax-overloaded-functions.html

pjax(InstantClick)一般需要重载的函数,希望这篇文章能让大家少浪费点时间

多说评论

if (typeof DUOSHUO !== 'undefined'){
DUOSHUO.EmbedThread('.ds-thread');} /

网易云跟贴

if (typeof Tie !== 'undefined') {
                        Tie.loader("", true);
            }

畅言(代码来自http://www.neurallinker.com/94.misaka)

if($("#SOHUCS").length==1){
window.changyan = undefined;window.cyan = undefined;
$.getScript("https://changyan.sohu.com/upload/changyan.js", function(){window.changyan.api.config({appid: "你的appid参数",conf: "你的conf参数"});});
}

百度统计

 if (typeof _hmt !== 'undefined'){
      _hmt.push(['_trackPageview', location.pathname + location.search]);
}

谷歌统计

if (typeof ga !== 'undefined'){
        ga('send', 'pageview', location.pathname + location.search);
}

piwik统计

 _paq.push(['setDocumentTitle', document.title]);
    _paq.push(['trackPageView']);

SynatxHighlighter

 SyntaxHighlighter.highlight();

google code prettify

   if (typeof prettyPrint !== 'undefined'){
      prettyPrint();
}

MathJax

if (isInitialLoad === false) {
    if (typeof MathJax !== 'undefined'){
      MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}

Prism.js语法高亮

 if (typeof Prism !== 'undefined') {
Prism.highlightAll(true,null);}

转载自:https://qqdie.com/archives/pjax-overloaded-functions.html

添加新评论