Jump to content

Disable AJAX loading on a single page only

Recommended Posts

Hello

 

I have a Calendly Integration on a webpage that doesn't load properly unless I disable AJAX loading.

 

The thing is that I want AJAX loading enabled, so I would like to paste some code in the heading of the page using Page Injection that disable AJAX loading for this single page. 

 

Can anyone help me with the exact code needed to do this?

 

Thanks in advance 

Link to comment

You cannot disable Ajax page loading for a single page. It can either be on for the entire site (on supported templates), or disabled altogether.

If you have a problem with a specific piece of code, it would be better to address this issue. Can you provide some more details? For example, a working link to the page and full details of the code you have added. 

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment

Thanks for the reply Paul and for clearing up why my extensive Google searches yielded zero results 😂

 

The embed code from Calendly is below (I've removed the URL)

 

<!-- Calendly inline widget begin -->
<div class="calendly-inline-widget" data-url="URL" style="min-width:320px;height:750px;"></div>
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
<!-- Calendly inline widget end -->

Link to comment

Can you provide me with a link to the actual page where this is installed? I can't troubleshoot it easily if I can't see the code running on the page.

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment
  • 6 months later...
  • 3 months later...
  • 1 year later...

For anyone coming to this in 2022 or beyond... 

I needed to force a re-read of some javascript (a button that linked to an outside URL with pre-filled data). My issue was that the button did not show when the page was navigated to via forward and back. I didn't want to disable Ajax loading for the whole site though. After trying lots of functions listed on W3C and StackOverflow to try and hook into forward/back navigation and force a page reload, I found that adding the following worked OK for me (effectively recognising it's a SquareSpace page being loaded and triggering your code to be run as a result):

<script>
  document.addEventListener('DOMContentLoaded', customCode);
  window.addEventListener('mercury:load', customCode);
  function customCode(){  
    /* Your function here */
  }
</script>

 

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.