“MediaWiki:Common.js”的版本间的差异
第6行: | 第6行: | ||
my_tongji.innerHTML ='var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://hm.baidu.com/hm.js?ac8de246093df91901203e42f297a1b1";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();' | my_tongji.innerHTML ='var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://hm.baidu.com/hm.js?ac8de246093df91901203e42f297a1b1";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();' | ||
console.log(my_tongji) | console.log(my_tongji) | ||
+ | my_head.appendChild(my_tongji); |
2020年2月26日 (三) 10:46的版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ var my_head = document.getElementsByTagName('head')[0]; console.log(my_head) var my_tongji = document.createElement('script'); my_tongji.innerHTML ='var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://hm.baidu.com/hm.js?ac8de246093df91901203e42f297a1b1";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();' console.log(my_tongji) my_head.appendChild(my_tongji);