Jump to content

Custom Javascript not working

Recommended Posts

Hi
We have a site with some custom javascript code on git
Last week this starting to fail, seems like .js files are not being uploaded on html file.
If you enter the first time to the site, it fails, but if you reload the page, it start working.
We are following the docs: https://developers.squarespace.com/custom-javascript
But we don't understand why this was working for so long and now is not.
All site is shown with all the html code, but we have a js file which should get uploaded, and it isn't.

Link to comment

It sounds to me like your site is v7.0 and you have Developer Mode turned on.

Quote

If you enter the first time to the site, it fails, but if you reload the page, it start working.

When I hear this I think the curse of Ajax. Perhaps someone has recently turned on Ajax Loading on your site and it wasn't on before. Turn it off and see if the problem goes away. If it does then you know the cause. Ajax Loading is designed to increase performance of your site. If your code doesn't work with Ajax Loading then it needs to be rewritten to do so.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.