Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Embedded Countdown JS not showing up


Drewster

Question

Site URL: https://www.saas-day.com/

Hello everyone!

I am currently struggling a bit with a countdown embedded script that just won't show on the page. I am currently using a Harris template from the York family and I would like to have a solution that does not imply to switch off Ajax loading.

Here's the code:

<center>

<h2 id="timer"></h2>

</center>

<script>

var countDownDate = new Date("Mar 11,
2021 09:00:00").getTime();var x = setInterval(function() {var now = new
Date().getTime();var distance = countDownDate - now;var days = Math.floor(distance /
(1000 * 60 * 60 * 24));var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 *
60 * 60));var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));var
seconds = Math.floor((distance % (1000 * 60)) /
1000);document.getElementById("timer").innerHTML = days + " Tage " + hours + " Std "+
minutes + " Min " + seconds + " Sek ";if (distance < 0)
{clearInterval(x);document.getElementById("timer").innerHTML = "";} }, 1000);

</script>

Thanks a lot for your help!

 

Link to post
  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0
1 hour ago, Drewster said:

Site URL: https://www.saas-day.com/

Hello everyone!

I am currently struggling a bit with a countdown embedded script that just won't show on the page. I am currently using a Harris template from the York family and I would like to have a solution that does not imply to switch off Ajax loading.

Here's the code:

<center>

<h2 id="timer"></h2>

</center>

<script>

var countDownDate = new Date("Mar 11,
2021 09:00:00").getTime();var x = setInterval(function() {var now = new
Date().getTime();var distance = countDownDate - now;var days = Math.floor(distance /
(1000 * 60 * 60 * 24));var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 *
60 * 60));var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));var
seconds = Math.floor((distance % (1000 * 60)) /
1000);document.getElementById("timer").innerHTML = days + " Tage " + hours + " Std "+
minutes + " Min " + seconds + " Sek ";if (distance < 0)
{clearInterval(x);document.getElementById("timer").innerHTML = "";} }, 1000);

</script>

Thanks a lot for your help!

 

Hvae you tried using code block instead of embed? 

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...