好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

pjax 百度统计失效解决(小指亲测)

百度统计在pjax失效解决办法:

原来百度统计的代码

<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?这里是网站统计id";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

修改后的百度统计代码

<script id="bd-hm">
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "//hm.baidu.com/hm.js?这里是网站统计id";
        hm.onload = function() {
            // 清除百度统计的加载标识
            delete window["_bdhm_loaded_这里是网站统计id"];
        };
        var s = document.getElementById('bd-hm');
        s.parentNode.insertBefore(hm, s);
    })();
</script>

找到pjax触发的容器,如本站使用的是#contentleft:

<div id="contentleft">...</div>

将修改后的百度统计代码添加到容器的最后,即</div>之前

删除其他地方重复部署的统计代码

注意:所有包含pjax触发容器的页面都需要添加百度统计代码


搞定啦^_^

点赞9
 标签: pjax 百度统计失效
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
cocoadancer
 cocoadancer 约 3 小时前回复
#122
<a href="http://www.myenergytruth.com/air-jordan-retro-14-dam%C3%A4nner-orange-rosa-schuheb">air jordan retro 14 dam盲nner orange rosa</a> <a href="http://www.sosalito.com/nike-womens-kyle-emanuel-ash-one-color-los-angeles-chargers-nfl-51-pullover-hoodie-nflr">nike womens kyle emanuel ash one color los angeles chargers nfl 51 pullover hoodie</a> <a href="http://www.stretart.com/adidas-red-wings-7-ted-lindsay-red-home-authentic-usa-flag-stitched-nhl-jersey-nflw">adidas red wings 7 ted lindsay red home authentic usa flag stitched nhl jersey</a> <a href="http://www.waardefabriek.com/air-max-thea-clear-water-blu-schuheg">air max thea clear water blu</a> <a href="http://www.agnnetworks.com/maschio-nike-free-3.0-v5-arancia-urine-scarpeg">maschio nike free 3.0 v5 arancia urine</a> <a href="http://www.axeaffaires.com/nike-zoom-pegasus-32-oransje-light-kurpesf">nike zoom pegasus 32 oransje light</a>
cocoadancer http://www.cocoadancer.com/
kalrakis
 kalrakis 约 10 小时前回复
#121
<a href="http://www.mistopup.com/nike-air-max-hvit-l%C3%A6r-mennns-obuvj">nike air max hvit l忙r mennns</a> <a href="http://www.sporbahispro.com/nike-huarache-utility-viola-scarpel">nike huarache utility viola</a> <a href="http://www.kalrakis.com/nike-air-huarache-bleu-orange-chaussuresh">nike air huarache bleu orange</a> <a href="http://www.xinyudaili.com/maschio-nike-dunk-high-blu-nero-gituttio-arancia-scarpeh">maschio nike dunk high blu nero gituttio arancia</a> <a href="http://www.marieluwasche.com/miami-heat-back-in-black-jersey-nfli">miami heat back in black jersey</a> <a href="http://www.ferrepress.com/mujer-nike-air-huarache-negro-blanco-zapatosh">mujer nike air huarache negro blanco</a>
kalrakis http://www.kalrakis.com/
enventsurvey
 enventsurvey 2019-03-19 09:05回复
#120
<a href="http://www.jupickuplines.com/air-jordan-retro-30-mint-green-gold-shoesh">air jordan retro 30 mint green gold</a> <a href="http://www.saleuggboot.com/nike-flyknit-racer-oro-azul-zapatosp">nike flyknit racer oro azul</a> <a href="http://www.fragmanizletv.com/nike-air-max-tailwind-8-mujeres-verde-oro-zapatosk">nike air max tailwind 8 mujeres verde oro</a> <a href="http://www.swisshomeas.com/north-face-osito-2-jacket-black-northfaceh">north face osito 2 jacket black</a> <a href="http://www.marinersdiary.com/dam%C3%A4nner-air-jordan-retro-5-schwarz-blau-schuhej">dam盲nner air jordan retro 5 schwarz blau</a> <a href="http://www.bourseasie.com/nike-kobe-9-high-gul-sort-skoh">nike kobe 9 high gul sort</a>
enventsurvey http://www.enventsurvey.com/
theskifanatic
 theskifanatic 2019-03-18 09:17回复
#119
<a href="http://www.romoautocare.com/maschio-asics-gel-noosa-tri-7-rosa-arancia-scarpel">maschio asics gel noosa tri 7 rosa arancia</a> <a href="http://www.industrialegy.com/nike-zoom-winflo-3-white-purple-shoesj">nike zoom winflo 3 white purple</a> <a href="http://www.bewustvitaal.com/michael-michael-kors-jet-set-large-leather-crossbody-clutch-mkh">michael michael kors jet set large leather crossbody clutch</a> <a href="http://www.flushandhunt.com/air-jordan-retro-14-kvinners-svart-gr%C3%A5-obuvi">air jordan retro 14 kvinners svart gr氓</a> <a href="http://www.kendalfewster.com/nike-kobe-9-nero-blu-scarpej">nike kobe 9 nero blu</a> <a href="http://www.gisusalon.com/air-jordan-retro-6-blue-orange-shoesh">air jordan retro 6 blue orange</a>
theskifanatic http://www.theskifanatic.com/
jonvietor
 jonvietor 2019-03-16 19:32回复
#118
<a href="http://www.rcnbundles.com/adidas-superstar-denim-dark-blau-wei%C3%9F-kurpesg">adidas superstar denim dark blau wei脽</a> <a href="http://www.whoreregistry.com/air-jordan-14-rosa-and-svart-yeezy-obuvb">air jordan 14 rosa and svart yeezy</a> <a href="http://www.desingbrain.com/air-max-1-sort-laser-crimson-hvid-butya">air max 1 sort laser crimson hvid</a> <a href="http://www.maytumcompany.com/nfl-nico-siragusa-womens-limited-camo-jersey-65-baltimore-ravens-nike-2018-salute-to-service-nflu">nfl nico siragusa womens limited camo jersey 65 baltimore ravens nike 2018 salute to service</a> <a href="http://www.parsoniidrs.com/herren-nike-air-max-thea-gelb-kurpesb">herren nike air max thea gelb</a> <a href="http://www.petcareomaha.com/nike-air-max-tailwind-svart-r%C3%B8d-and-svart-schuhed">nike air max tailwind svart r酶d and svart</a>
jonvietor http://www.jonvietor.com/
crypolio
 crypolio 2019-03-15 22:54回复
#117
<a href="http://www.sophiecrooks.com/air-jordan-super.fly-5-nero-oro-scarpel">air jordan super.fly 5 nero oro</a> <a href="http://www.hkelitemodels.com/bon-march%C3%A9-nike-free-4.0-flynit-femmes-rouge-noir-chaussuresh">bon march茅 nike free 4.0 flynit femmes rouge noir</a> <a href="http://www.graciecomm.com/nike-magista-onda-fg-nero-scarpeh">nike magista onda fg nero</a>
crypolio http://www.crypolio.com/
voydnet
 voydnet 2019-03-15 09:52回复
#116
<a href="http://www.thebiarritz.com/kvinners-asics-gel-hyper-33-s%C3%B8lv-gr%C3%B8nn-obuvi">kvinners asics gel hyper 33 s酶lv gr酶nn</a> <a href="http://www.voydnet.com/adidas-superstar-s%C3%B8lv-gr%C3%B8nn-obuvp">adidas superstar s酶lv gr酶nn</a> <a href="http://www.foneandlone.com/nike-flyknit-trainer-s%C3%B8lv-gr%C3%B8nn-obuvi">nike flyknit trainer s酶lv gr酶nn</a> <a href="http://www.roomwhiz.com/nike-hyperdunk-wolf-gris-fireberry-dynamic-azul-zapatosp">nike hyperdunk wolf gris fireberry dynamic azul</a> <a href="http://www.riffsurfers.com/coach-bag-bag-coachh">coach bag bag</a> <a href="http://www.davidmgaines.com/nike-air-max-95-orange-black-shoesj">nike air max 95 orange black</a>
[url=http://www.voydnet.com/]voydnet[/url]
tatilblogu
 tatilblogu 2019-03-15 07:18回复
#115
<a href="http://www.findatrans.com/femminile-nike-air-presto-viola-rosa-scarpej">femminile nike air presto viola rosa</a> <a href="http://www.isabellerigal.com/womens-nike-kyrie-2-grey-sky-blue-shoesh">womens nike kyrie 2 grey sky blue</a> <a href="http://www.esnafkocaeli.com/nike-huarache-utility-hombresta-verde-zapatosk">nike huarache utility hombresta verde</a> <a href="http://www.dkdjabar.com/nike-air-max-tn-p%C3%BArpura-negro-zapatosp">nike air max tn p煤rpura negro</a> <a href="http://www.jamiecirillo.com/north-face-summit-gore-tex-northfaceh">north face summit gore tex</a> <a href="http://www.xpostshopx.com/air-jordan-retro-14-lila-blau-schuhej">air jordan retro 14 lila blau</a>
tatilblogu http://www.tatilblogu.com/
tickboxit
 tickboxit 2019-03-14 14:38回复
#114
<a href="http://www.smsteachers.com/vibram-fivefingers-komodo-nero-verde-schuhee">vibram fivefingers komodo nero verde</a> <a href="http://www.viviancontigo.com/nike-free-flyknit-3.0-kvinners-gull-r%C3%B8d-scarped">nike free flyknit 3.0 kvinners gull r酶d</a> <a href="http://www.drlunaworld.com/nfl-nike-new-york-jets-11-robby-anderson-green-backer-long-sleeve-t-shirt-nflx">nfl nike new york jets 11 robby anderson green backer long sleeve t shirt</a> <a href="http://www.eatisrael.com/limited-mens-deshaun-watson-black-jersey-nfl-nike-houston-texans-4-2016-salute-to-service-nflz">limited mens deshaun watson black jersey nfl nike houston texans 4 2016 salute to service</a> <a href="http://www.ebikingcenter.com/air-yeezy-ii-2-sp-max-90-hommes-bon-march%C3%A9-kurpesa">air yeezy ii 2 sp max 90 hommes bon march茅</a> <a href="http://www.eulatestnews.com/adidas-zx-900-weave-oransje-peel-butyg">adidas zx 900 weave oransje peel</a>
tickboxit http://www.tickboxit.com/
animalpainvet
 animalpainvet 2019-03-14 05:23回复
#113
<a href="http://www.adanastarpen.com/kvinders-air-jordan-retro-9-lilla-hvid-skoi">kvinders air jordan retro 9 lilla hvid</a> <a href="http://www.actconfident.com/air-jordan-retro-14-kvinners-himmelen-bl%C3%A5-lilla-obuvq">air jordan retro 14 kvinners himmelen bl氓 lilla</a> <a href="http://www.erzurumihl.com/womens-nike-air-max-bw-white-yellow-shoesh">womens nike air max bw white yellow</a> <a href="http://www.candctowingil.com/maschio-asics-asics-gel-kayano-17-verde-rosso-scarpei">maschio asics asics gel kayano 17 verde rosso</a> <a href="http://www.onlysidekick.com/nike-air-max-gr%C3%BCn-rot-schuhej">nike air max gr眉n rot</a> <a href="http://www.rmmassage.com/pink-notre-dame-hat-hath">pink notre dame hat</a>
animalpainvet http://www.animalpainvet.com/
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸