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
  • Replies 5
  • Views 637
  • Created
  • Last Reply
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

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, 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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.