Jump to content

Embedded code not loading without refresh

Recommended Posts

Site URL: https://www.merakigold.com/collections-shop/going-camping

Code for estimated delivery date not loading without refreshing page. After refreshing works fine. Ajax on this template is disable.

<style>
#futuredate{color:#acacac;display:inline-block;text-align:center;font-size:1.0rem} #futuredate>
div{padding:10px; background:#ffffff; display:inline-block} #futuredate div>
span{padding:10px; display:inline-block} 
</style>

<center>
<div id="futuredate">
<div><div class="text">Order Before Midnight EST Estimated Delivery Date - <span class="dates" id="date"></span></div>
</div>
</center>

<script>
var today=new Date();
today.setDate(today.getDate() + 8);
var y=today.getFullYear();
var m=today.getMonth()+1;
var d=today.getDate();
var dates=m+'-'+d+'-'+y

document.getElementById("date").innerHTML=dates;
</script>
 

Link to comment
2 hours ago, Tiffc-MG said:

Site URL: https://www.merakigold.com/collections-shop/going-camping

Code for estimated delivery date not loading without refreshing page. After refreshing works fine. Ajax on this template is disable.

<style>
#futuredate{color:#acacac;display:inline-block;text-align:center;font-size:1.0rem} #futuredate>
div{padding:10px; background:#ffffff; display:inline-block} #futuredate div>
span{padding:10px; display:inline-block} 
</style>

<center>
<div id="futuredate">
<div><div class="text">Order Before Midnight EST Estimated Delivery Date - <span class="dates" id="date"></span></div>
</div>
</center>

<script>
var today=new Date();
today.setDate(today.getDate() + 8);
var y=today.getFullYear();
var m=today.getMonth()+1;
var d=today.getDate();
var dates=m+'-'+d+'-'+y

document.getElementById("date").innerHTML=dates;
</script>
 

You can consider turn off ajax for your site

Ajax loading – Squarespace Help Center

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.