Jump to content

Script not running on initial load

Recommended Posts

I recently switched from the Peak template to the Impact template. I have three forms that are managed through a script that sends the data back to our donor manage system coded into the page. The script loaded and functioned perfectly on the Peak template, but now that I have switched to the Impact template, the scripts won't run on initial load. You actually have to reload the page to get the form to show up. Since the same script worked on the old template as well as on the new template once the page is reloaded, it seems pretty obvious to me that there is some kind of error in the code base for the Impact template that is not executing the script on initial load. Jessii from Squarespace has been giving me the runaround all week, insisting that the problem has to be with the script, when it clearly isn't. Anyone out there have any idea what else I can do on my end to encourage the script to load? (Or alternatively, to reach someone at Squarespace who can actually aid me with this problem?)

Link to comment
  • Replies 1
  • Views 1k
  • Created
  • Last Reply

Hi.

First let me explain why Squarespace support can't help in your circumstances. Their remit is limited to support of their own product; they don't troubleshoot code that you've added.

I can't confirm the exact cause of your issue without the URL of your site or the code that you've used, but I'd say, with a high degree of certainty, that it your code isn't Ajax (asynchronous JavaScript and XML) compatible.

Peak is an old, now discontinued template, that pre-dates Ajax, but Impact is part of the newest template family (Brine) and it does use Ajax. I've written a longer explanation about Ajax on Squarespace here:

https://sf.digital/squarespace-solutions/why-doesnt-my-code-work-until-i-refresh-the-page

-Paul

Squarespace Expert & Professional Developer

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

Archived

This topic is now archived and is closed to further replies.

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