Need new pair of eyes for countdown code

  • 1
  • Question
  • Updated 9 years ago
  • Answered
I have a countdown code that I need very badly. It works when I have it has a .htm file on my computer but when I paste it into Yola, it doesn't work. Here it is:

<!--
<SCRIPT LANGUAGE="JavaScript">
<!--
// Author: Patrick Fairfield
// Fairfield Consulting
// change your event date event here.

var eventdate = new Date("May 30, 2009 21:21:00");

function toSt(n) {
s=""
if(n<10) s+="0"
return s+n.toString();
}

function countdown() {
cl=document.clock;
d=new Date();
count=Math.floor((eventdate.getTime()-d.getTime())/1000);
if(count<=0)
{cl.days.value ="----";
cl.hours.value="--";
cl.mins.value="--";
cl.secs.value="--";
return;
}
cl.secs.value=toSt(count%60);
count=Math.floor(count/60);
cl.mins.value=toSt(count%60);
count=Math.floor(count/60);
cl.hours.value=toSt(count%24);
count=Math.floor(count/24);
cl.days.value=count;

setTimeout("countdown()",500);
}
// end hiding script-->

Days:
Hours:
Mins:
Secs:

Until



-->
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes

Posted 9 years ago

  • 1
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
It's because Yola doesn't permit .htm files to be uploaded. Sorry lambofgod. Could you maybe trying uploading the .htm file to a file hosting site and then link to it?
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Never mind, I wasn't trying to upload the htm file. I was just saying that it worked in a html file. I found out I forgot to add a body tag. Thanks for your help littleus!
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
I'm glad that you got it figured out. =)