Please, anyone, tell me what I do that my website displays date and time does not get reset on refreshing the page. what I add extra is that my date timer does not get reset on refreshing the page
$(window).on("load", function () {
var clock;
clock = $(".clock").FlipClock({
clockFace: "DailyCounter",
autoStart: false,
callbacks: {
stop: function () {
$(".message").html("The IDO has been started!");
},
},
});
clock.setTime(30000);
clock.setCountdown(true);
clock.start();
});
Onload gets triggered when refreshing the site. You‘d have to save the state outside the scope of the function. If you‘re using a statis webpage and you simply added the script to the head, then the script always gets executed on page load. Look into webservers. Node.js with express library for example.