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

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation 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.

Buy me a coffee

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.