不蒜子重写
This commit is contained in:
tangly1024
2021-12-21 14:29:00 +08:00
parent ac7ff2e912
commit c1ab81b11e
5 changed files with 40 additions and 18 deletions

View File

@@ -55,7 +55,7 @@ bszCaller = {
const fetch = () => {
bszTag && bszTag.hides()
bszCaller.fetch('//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback', function (t) {
// console.log('不蒜子请求结果',t)
console.log('不蒜子请求结果',t)
bszTag.texts(t), bszTag.shows()
})
}
@@ -64,20 +64,32 @@ bszTag = {
bszs: ['site_pv', 'page_pv', 'site_uv'],
texts: function (n) {
this.bszs.map(function (t) {
const e = document.getElementById('busuanzi_value_' + t)
e && (e.innerHTML = n[t])
const e = document.getElementsByClassName('busuanzi_value_' + t)
if(e){
for (var element of e) {
element.innerHTML = n[t]
}
}
})
},
hides: function () {
this.bszs.map(function (t) {
const e = document.getElementById('busuanzi_container_' + t)
e && (e.style.display = 'none')
const e = document.getElementsByClassName('busuanzi_container_' + t)
if(e){
for (var element of e){
element.style.display = 'none'
}
}
})
},
shows: function () {
this.bszs.map(function (t) {
const e = document.getElementById('busuanzi_container_' + t)
e && (e.style.display = 'inline')
const e = document.getElementsByClassName('busuanzi_container_' + t)
if(e){
for(var element of e){
element.style.display = 'inline'
}
}
})
}
}