0

我的 jquery 中有一个变量,我想在每次页面刷新时将其设置回零。现在看起来页面是用 $counter == 0 初始化的。我的代码更改了 $counter 的值,但每次重新加载页面时,它似乎并没有恢复为零值。刷新页面后是否可以再次将 $counter 设置为零?(使用铬)。

$(document).ready(function() {

    var $counter = 0

    // Do some stuff with $counter and the value of $counter changes...

});  
4

0 回答 0