- <script>
- var defaultValue = 5;
- var plus = 1;
- var max = 100;
- var total = defaultValue;
-
- window.setInterval(
- function () {
-
- if (total > max){
-
- total = defaultValue;
- }
-
- document.getElementById("demo1").innerHTML = total;
- total = total + plus;
- }, 1000);
-
- </script>
- <p id="demo1"></p>

我想把total放在一个txt file或者mysql里,需要的时候再read by txt或server,这样即使我refresh browser也可以不会重新开始计算,但是我要如何把total从javascript pass value去php里呢?(每一秒write and read)
我找了好几天的资料了,不是用form的方式就是function不到,唉
