I have a script that I am trying to use to show one text during part of the day and different text during another. I have found a script that would work, but it requires me to use an onload event in the body tag, which it don’t believe I can do in Unbounce. Do anyone know another solution for this?
Here is the code:
var OPENAT = 8;
var CLOSEAT = 18;
function areWeOpen( ) {
var sign = document.getElementById(“openSign”);
var day = new Date().getDay();
var hour = new Date().getHours();
var mins = new Date().getMinutes();
hour = hour + mins/60;
if ( day >=1 && day = OPENAT && hour < CLOSEAT ) {
sign.innerHTML = “555-555-5555”;
sign.className = “OPEN”;
}
else {
sign.innerHTML = “Sorry, we are now CLOSED”;
sign.className = “CLOSED”;
}
}