Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Ajax 中建立了一个不起作用的小计数器。Ajax 计数器会破坏整个代码;<script>一旦将计数器添加到元素中 ,即使另一个不依赖计数器的函数也会停止工作。为什么我的计数器会破解密码?
<script>
下面是 Ajax 代码:
//My attempt at a counter. This breaks the code. var indx=0; calcIndex(){ return indx++; } function ajax2(){...}
代替
var indx=0; calcIndex(){ return indx++; }
和
var indx=0; function calcIndex(){ return indx++; }