- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
08-10-2016 09:18 AM
I have a javascript timer running on each of my pages that sends a ping and increments every 10 seconds. E.g. 10, 20, 30 , 40 etc. I want to pass this value to the next page and continue to increment. Any best practices or suggestions on how to easily do this. I want to have two variables a page time variable and a cumulative session time variable. It should look something like this.
Page time Cumulative time
page a 10 10
page a 20 20
page b 10 30
page c 10 40
08-10-2016 01:52 PM - last edited on 08-10-2016 01:56 PM by kathleen_jo
Hello @joecbrown. In order to accomplish this you would need to leverage cookie or sessionstorage for each page. When the page initially loads in, you would want to write some custom JS that would verify if your interval is actually running at that point. If it isn't, you would then look at the data that had been persisted in the local storage, utilize that data for the incrementing storage, and then begin your interval again.
Copyright All Rights Reserved © 2008-2023