Jump to content

Code block - Adding javascript

Recommended Posts

Site URL: https://lume.energy

Hi!

I I have tried to add a lottie file via script/JSON to my Squarespace page. However when I try to add code/JS to a block and choose Javascript something wierd happens. I cannot in any way shape or form get SS to show the actual file or run the script. Iv tried support but they dont help and refer me to forum:(. Please if anyone has done this and knows what to do please help. Iv added it in the way they recommend

Editor

https://d.pr/free/i/OpNNK0

 

Example on page > https://d.pr/free/i/TQjQRO

<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<lottie-player src="https://lumebackground.s3.eu-north-1.amazonaws.com/Animation.json"  background="transparent"  speed="1"  style="width: 300px; height: 300px;"  loop controls autoplay></lottie-player>

 

Appreciate all help I can get. Thanks

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

2 hours ago, YngveB said:

I have tried to add a lottie file via script/JSON to my Squarespace page. However when I...choose Javascript something weird happens.

The code you have posted in your question isn't JavaScript, it is HTML. If you choose HTML you shouldn't see errors.

   If a post helps you, please click a "Like" option below  ↘️

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity 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.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

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.