Jump to content

Use javascript with squarespace without code block

Recommended Posts

I like to use WSIWYG from Squarespace to format my text and for each text, i like to add a hyperlink like this:

See video

with this as URL -> href="javascript:videoPlay(5)"

I prefer not to use a code block so that I can use SS's WSIWYG features.

I have declared videoPlay in the code injection section. I have the business plan.

Is this possible?

Edited by dbliss20
improve clarity
Link to comment
On 5/19/2021 at 6:38 PM, creedon said:

Add your href value into a link in the text block.

232321043_ScreenShot2021-05-19at6_34_01PM.png.bf683efa2f6efcd64fd57d8a60a031f0.png

It's the chain link icon on the toolbar.

Let us know how it goes.

It works great to create the link. However when I go back to edit it, the JavaScript href is gone. Is there an easier way to edit it? It seems I have to remove the link and recreate it to perform an edit.

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.