Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 1

Need help installing my widget code script - code blocks not working


nickcharliekey

Question

Site URL: https://www.signaturesmiles-nc.com/request-appointment-1

Hello!

I'm trying to install the following widget code script  but it's not working in the code block. The company's tech support says it's a plug and play solution and that they have lots of SQSP users but I can't seem to make it work. Any help would be much appreciated:

 

<script src="https://d3ivs86j8l3a5r.cloudfront.net/flexBook.js"></script>

initFlexBook('https://flexbook.me/sigsmiles')

 

 

Link to comment

7 answers to this question

Recommended Posts

  • 1
1 hour ago, nickcharliekey said:

it forces a popup on page load, is there anyway to make it open on a click, either by button or have it appear in an iframe perhaps?

Yes, you should be able to do either of these!

iframe

To use an iframe, simply add the link (https://flexbook.me/sigsmiles) to some simple iframe code inside a Code Block. You won't need the rest of the code that you quoted above. For example, this should be all you need:

<iframe src="//flexbook.me/sigsmiles" width="100%" height="985px" style="border:none;">
</iframe>

Click button

To launch the popup from a button in the header, add a new 'Link" to the navigation in the same position (replacing the page). You can remove the code block.

Set the URL of the new navigation link to "#". Then you'll need to add a few lines of code to Settings > Advanced > Code Injection > Footer:

<script src="https://d3ivs86j8l3a5r.cloudfront.net/flexBook.js"></script>
<script>
  apptBtn = document.querySelector(".horizontal-navigation-bar nav > ul > li:last-child");
  apptBtn.addEventListener("click", function() {
    initFlexBook('https://flexbook.me/sigsmiles')
  });
</script>

Once saved, this should launch the popup like this:

appt-button-book.gif.3b2f846476119a95beb49f46b5ead210.gif

Note: Like all the code posted on this forum, this is a simplified example. It has been provided without warranty. For a supported solution from a professional developer, I recommend booking a Squarespace Expert.

Edited by paul2009

About Paul: Circle Community Leader who values honesty, transparency, respect and appreciation ♥.
Work: Squarespace Expert and founder of 
SF Digital, a company dedicated to improving Squarespace websites by building the features Squarespace didn't include™. See our range of extensions for Squarespace to improve your store.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Link to comment
  • 0

@tuanphanThanks so much for replying...it's not currently on the page as it's not working in the code block, embed block or header page injection..

Got it from a company called Flex who do dental appointment scheduling. They seem to say its a plug and play solution but it doens't work. I'll readd it to the page so you can see how its interacting.

 

Link to comment
  • 0
16 hours ago, nickcharliekey said:

@tuanphanThanks so much for replying...it's not currently on the page as it's not working in the code block, embed block or header page injection..

Got it from a company called Flex who do dental appointment scheduling. They seem to say its a plug and play solution but it doens't work. I'll readd it to the page so you can see how its interacting.

 

I think this code (in red box) should have an opening & closing tag (something like this <script>initFlexBook('https://flexbook.me/sigsmiles');</script>)

Can you check again?

this-code.png.d2daf9d6e55781870f358d2a74d258a1.png

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