How can I display the same time on another page without using cookies because its just a local website and database isn't such a good idea? Is there something else I can do?
Asked
Active
Viewed 35 times
-1
-
You want it in real time or at the end ? – Lau Jun 08 '15 at 13:05
-
**real time going on** – Jun 08 '15 at 13:21
1 Answers
1
local storage should be very ok.
example :
//page A
var counted_time=[your algorithm result];
localStorage.setItem("mytime_hey", counted_time);
//page B
var mytime = localStorage.mytime_hey;
$("#mydiv").html("your time is"+mytime+" !");
//// if your question is : how to count ? that s another matter. make a difference between 2 date : How Many Seconds Between Two Dates?
-
I don't need it as a particular time actually the time is being counted and then I want to show the user that how much time it took him to complete my questions in another link – Jun 08 '15 at 13:18
-
allright. my code does. setItem("whatyouwant", what_var_u_want); ... see my edit – 3pic Jun 08 '15 at 13:20