0

This is script

<script>
var time=1;

function timeHere() {
  time = time + 1;
  finalTime = time / 10;

}

function sayTime() {
  finalTime = time / 10;
  
}
</script>

<body onload='window.setInterval("timeHere()", 100)' onunload="sayTime()">

</body>

I want to get the time i.e. value of finalTime in ajax varable.

Not using cookie, becoz it gives value on same page but after reloading page am using this to javaScript to php

How i get this without reloading or refreshing page...
so question is How to save value of variable in javaScript to ajax variable??

means save value of finalTime in ajax variable
How to do this??

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by ~s.o.s~
0

There is no such thing as AJAX variable. In case if you want to persist a Javascript variables' value to a persistent store by making an async request to the server, you can just append the value in consideration to the query string like:

http://your.server/?value=yourValue

which would be read at the server (using a server side environment of your choice) and then persisted.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.