Jump to content

Adding javascript to code block button

Recommended Posts

I want to apply a small piece of javascript code to a button.

The code is as follows:

<script type="text/javascript" src="https://createsend.aviarycreative.co.uk/h/r/1A210D00A711F307/86F32859A5B4521C/popup.js"></script>

I'm not a developer so wondered if anyone can help apply this to a button using the code block?

Link to comment
On 12/17/2020 at 10:39 PM, danjc said:

I want to apply a small piece of javascript code to a button.

The code is as follows:

<script type="text/javascript" src="https://createsend.aviarycreative.co.uk/h/r/1A210D00A711F307/86F32859A5B4521C/popup.js"></script>

I'm not a developer so wondered if anyone can help apply this to a button using the code block?

You should provide your site url and the document provided by creatsend on how to add the popup to a button to help

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

I'm not a developer either so I'm also eager to see answers from others, but here's an example of code that I'm using to do this (from my site sisucinemarobotics.com):

<center>
<a onclick="pixelDemo()" href="https://app.squarespacescheduling.com/schedule.php?owner=********&appointmentType=********" class="acuity-embed-button" style="background: transparent !important; color: #1984c2; font-family: 'oswald','omnes-pro',sans-serif; font-weight: 500; font-size: calc(.12vw + 1rem); padding: 1.3rem 2.171rem; letter-spacing: .03em; border: 0px; -webkit-box-shadow: 0 -2px 0 rgba(0,0,0,0) inset;-moz-box-shadow: 0 -2px 0 rgba(0,0,0,0) inset;box-shadow: 0 -2px 0 rgba(0,0,0,0) inset;border-radius: 0px; text-decoration: none; display: inline-block; border-style: solid; border-width: 2px; border-color: #1984c2;">Schedule a Demo</a><link rel="stylesheet" href="https://embed.acuityscheduling.com/embed/button/********.css" id="acuity-button-styles" /><script src="https://embed.acuityscheduling.com/embed/button/********.js" async></script>
  <script>
    function pixelDemo(){
    fbq('trackCustom', 'ScheduleADemo', {page: 'home'});
    }
  </script>
</center>

 

Link to comment
  • 2 weeks later...

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.