if i refreshing the page it gets reset from 0;
what i need to do ?
which technologies i need to use.
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
20 messages · Page 1 of 1 (latest)
if i refreshing the page it gets reset from 0;
what i need to do ?
which technologies i need to use.
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
For client-side persistence of simple data https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
@vale widget thanks for reply
but it works on same browser
like i change browser and session ended its starts from 0
Of course
Client data is not shared between browsers, that would be awful
If you want to persist data for a same IP, you need a server
You can save the timer alongside the ip on your server, whether on the file system or in a database
Then from where i need to fetch i think
Use local storage to save the start time. On page load, check if local storage has a start time saved. If it does, start count down based on difference between current time and start time. If there is no saved value, start count down from current time and save current time in local storage.
You might need to add some kind of maximum duration or manual clearing function if you do this. Otherwise, someone who uses this counter a second time several days later will still have it resume from the previous session.
@grand stream but local stroage doest't work for me
I'm trying to build like this
If you need the clock to continue running and be able to generate a notification after the web page has closed, you will need to use a web worker.
If you have a server just send a request to it. Browsers have fetch natively