Jump to content

Adding an Onclick Attribute to a Squarespace Button

Recommended Posts

Posted (edited)

I am new to this and this is driving me crazy! I was given this code to make Service Titan's Web Scheduler pop up. We have put it in all the places they said to and nothing works! I know I'm just not doing it right. Can someone please tell me how to make it work? We would like the button that says "Book Appointment Now" to open the pop-up.

Website: https://sandersplumbinghvac.com/home-1

Install Web Scheduler

1. Please paste this code at the end in the <body>:

<script>   (function(q,w,e,r,t,y,u){q[t]=q[t]||function(){(q[t].q = q[t].q || []).push(arguments)};     q[t].l=1*new Date();y=w.createElement(e);u=w.getElementsByTagName(e)[0];y.async=true;     y.src=r;u.parentNode.insertBefore(y,u);q[t]('init', 'ca6914fd-c5ac-4c51-a045-0b160476865a');   })(window, document, 'script', 'https://static.servicetitan.com/webscheduler/shim.js', 'STWidgetManager'); </script>

 

2. Please add the following onclick attribute to your desired html element:

onclick=STWidgetManager("ws-open")

Edited by KieraA
  • Replies 1
  • Views 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.