Join the Webstudio community

Updated 4 months ago

How to add custom javascript on the page?

At a glance

The community member is trying to add a particle effect to a section of their website by using an Embed HTML component, but the effect only appears briefly and then vanishes. They are unsure why this is happening and ask if there is a way to add JavaScript to the entire page instead of using the Embed HTML component.

In the comments, another community member suggests that the "client only" flag is likely missing, which is a setting in the Embed HTML component. Another community member provides a link to a published website where the issue can be seen, and the original poster confirms that the particle effect is visible briefly but then disappears.

The community members discuss the issue, and one suggests that the "client only" flag is the setting that needs to be added, but the original poster is unsure how to do this.

Useful resources
Hello. I am trying to add particle effect on a section by adding an embed HTML component on the section. However, it seems that after adding the script it appears for a split second and then vanishes. I am not sure what is happening. Is there a way I can add js to the entire page instead of using the embed HTML component?
J
O
r
6 comments
HTML Embed is the way to go. Can you provide a video of what you're seeing and/or a builder share link so I can see?
most likely client only flag is missing
Hi @Oleg Isonen @John Siciliano thank you for the prompt reply.

Attached is the video of the studio screen. I have added the embed HTML component and the JS to it for the particle effect. The preview works fine and I can see the particle.

However, after the site is published - https://precise-website.wstd.io/ the particle effects vanish (it actually shows up for a split second after loading and then vanishes). Can you please help?
@Oleg Isonen thank you for the reply; apologies for being naive, am not sure how to add the client only flag :(.
It's the setting you already saw on html embed
Add a reply
Sign up and join the conversation on Discord