The problem of JS countdown

there is a JS countdown problem. The A page clicks the button to jump to the B page. After loading the B page, I immediately executed the JS countdown code for 1 minute. After execution, I clicked on the browser to return to the previous page to the A page, and then clicked again on the browser to return to the next page B page. At this time, the code for executing the JS countdown began to be executed again.
the requirement is that the JS countdown code is executed only once, and how to prevent the js code from being executed after clicking the up and down return function.
I just thought of several solutions, none of which are ideal.
I would like to ask which friend to provide ideas for solving the next problem.

Feb.27,2021

Local localStorage stores a state, such as hasCountDown
once it has been executed, set hasCountDown = true;
to read hasCountDown, every time you enter the page if hasCountDown = true, do not perform a countdown


store localStorage or sessionStorage with an ID

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30e75-402dc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30e75-402dc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?