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. 

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

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.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

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.