Skip to content

Commit d7ddb61

Browse files
committed
解决百度统计出错影响网页其它功能
1 parent ad3f82b commit d7ddb61

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,15 @@ <h4 class="card-title">{{ loginType == "login" ? "登录" : (loginType == "regis
508508
<script>
509509
var _hmt = _hmt || [];
510510
(function() {
511-
var hm = document.createElement("script");
512-
hm.src = "https://hm.baidu.com/hm.js?b8fc421d7c0dc354c6c8fb5a2c4f7729"; //cn
513-
// hm.src = "https://hm.baidu.com/hm.js?965ec968d2d53b729b90efc7ffb3ead2"; //org
514-
var s = document.getElementsByTagName("script")[0];
515-
s.parentNode.insertBefore(hm, s);
511+
try {
512+
var hm = document.createElement("script");
513+
hm.src = "https://hm.baidu.com/hm.js?b8fc421d7c0dc354c6c8fb5a2c4f7729"; //cn
514+
// hm.src = "https://hm.baidu.com/hm.js?965ec968d2d53b729b90efc7ffb3ead2"; //org
515+
var s = document.getElementsByTagName("script")[0];
516+
s.parentNode.insertBefore(hm, s);
517+
} catch (e) {
518+
console.log('BaiduStatistics: catch\n' + e.message)
519+
}
516520
})();
517521
</script>
518522
<!-- 百度统计 >>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->

0 commit comments

Comments
 (0)