Jump to content

Adding an Onclick Attribute to a Squarespace Button

Recommended Posts

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
Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

The only way is use Code Block to add (2) code, then style it same as Squarespace button

If you still want this, let me know, I will test then give you exact code

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.