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

Script Disabled message when adding a timer widget to my 7.1 version site


britchiz

Question

Site URL: http://prwomeninbusiness.squarespace.com

Hi! Thanks for taking the time to read. I'm trying to imbed a countdown timer widget into my page. I've followed all the instructions and read a lot of forums to see why I'm getting a script disabled code. I am a complete novice at this so go gentle with me :)

Here's what I've tried based on other forums:

-Logging out, viewing the page from an incognito tab

-Disabling Ajax, that doesn't apply because Ajax isn't used with 7.1 versions of squarespace

-Triple checking I've copied the code correctly

I've attached screen shots of it while I'm in editing mode and when I'm in visitor mode. As you can see in visitor mode, it's like nothing even exists. 

Here is a copy of the code I'm using:

<center><h2 id="timer"></h2></center><script>var countDownDate = new Date("Jun 16,
2021 19: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 + "d " + hours + "h "+
minutes + "m " + seconds + "s ";if (distance < 0)
{clearInterval(x);document.getElementById("timer").innerHTML = "Influential Women of the Year Awards - Live on Facebook!";} }, 1000); </script>

 

What am I doing wrong?! How do I fix it?

Screen Shot 2021-04-23 at 12.31.12 PM.png

Screen Shot 2021-04-23 at 12.38.38 PM.png

Link to post
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Posted Images

1 answer to this question

Recommended Posts

  • 0

I'm interested to know where you found this code, because the original code has some strange breaks and spaces in it that shouldn't be there! I think your the third or fourth person to have copied the code and asked for help!

For example, this should be one line:

var countDownDate = new Date("Jun 16, 2021 19:00:00").getTime();

See this other thread:

Regarding 'Script Disabled', it's normal to see this when you're logged on to Squarespace. 

sf-digital-signature-logo-email145.png.46606a2288a2847f44d81b9b7b58f3a5.png
Hi, I'm Paul, founder of SF Digitalbuilding the features that Squarespace didn't include. Pick dates in any format, show prices in other currencies, take orders without payment or improve your cartI value honesty, integrity, transparency and respect. Links in my posts may refer to SF Digital products or may be affiliate links.  Squarespace. I've been a loyal supporter of the platform since 2007. 

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...