Jump to content

sebastianadams

Member
  • Posts

    1
  • Joined

  • Last visited

sebastianadams's Achievements

  1. I've been working on custom code to programmatically populate a list of works page from a Firestore database. In VSCode/localhost everything works perfectly, but I am trying to add event listeners to every element in a class (downloadScore) and when the code is running on squarespace those event listeners don't work. As other event listeners I create in a similar manner do work, and because it works in localhost (without Squarespace page around it), I am thinking it might be an interaction between my code and the squarespace code. I'm wondering if anybody else has hit this problem or a similar one when injecting event listeners? My page is a 7.0 Wells site, there's no option to turn off AJAX in styles, and I have tried using a script I found on the forum to turn that off too, it seemed to make no difference. Update: I solved the problem myself. It was a combination of two things - I needed to chain a then to the promise made by the Firestore function to ensure the eventlisteners didn't run too early, and there was an undefined variable (actually probably caused by another bug in my code...) breaking the Firestore promise early. I think...not an expert at all....but hoping this could be helpful to nudge anybody else in the righr direction.
×
×
  • 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.