britchiz Posted April 23, 2021 Share Posted April 23, 2021 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? Link to comment
paul2009 Posted April 23, 2021 Share Posted April 23, 2021 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. About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. Content: Links in my posts may refer to SF Digital products or may be affiliate links. If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment