<script>
function name() {
let getList = JSON.parse(localStorage.getItem('list') || '[]')
let data = new Date()
let shi = data.getHours()
let fen = data.getMinutes()
let miao = data.getSeconds()
let time = `${shi}:${fen}:${miao}`
let listItem
if (getList.length) {
let newCount = getList[getList.length - 1].count + 1
listItem = { count: newCount, time: time }
} else {
listItem = { count: 1, time: time }
}
getList.push(listItem)
jsonList = JSON.stringify(getList)
localStorage.setItem("list", jsonList)
let abc = getList.map(item => {
return `刷新次数为${item.count},刷新时间为${item.time}<br>`
}).join('')
document.body.innerHTML = abc
}
setInterval((()=>{
name()
window.scrollTo(0, document.body.scrollHeight);
}),100)
</script>
12-01
418
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-27
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交