hello there,
my radio site is a wix site, now i need to make a text line that will change by hour for every show that the radio broadcast now (Live) .
any idea friends?
thanks, Erez.
hello there,
my radio site is a wix site, now i need to make a text line that will change by hour for every show that the radio broadcast now (Live) .
any idea friends?
thanks, Erez.
You can use setInterval() to check the time every x milliseconds, using new Date().
If the time is Y, run whatever action you want.
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval ,
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
i need to know java.s basics to do so?
can you sand me to a good guide to learn more?
thanks for the help J. D.
Very basic JavaScript.
You should do something like:
let currentHour = new date().getHour();//it'll pull the current round hour.
let checkIntervalInSeconds = 60;//check the time every 60 seconds
setInterval(() => {checkTime()}, checkIntervalInSeconds * 1000);
function checkTime(){
currentHour = new date().getHour();
if (currentHour === 14) {
//code for whatyou want to do if it's 2PM
}
}