我尝试在 localStorage 中输入一个数字,但 ++ 没有其他方式吗?
window.localStorage.setItem('run','++')
这是完整的代码
<script type="text/javascript">
if(window.localStorage.getItem('run')==null){
window.localStorage.setItem('run','1')
}
else if(window.localStorage.getItem('run')==1){
window.localStorage.setItem('run','++')
window.location = "index_aerosoft.html";
}
else if(window.localStorage.getItem('run')==25){
alert("hey 25times");
window.localStorage.setItem('run','null')
};
</script>