Trigger JS pop-up with a button

Hi,
I’m working on a client site, and they are using an online booking site. They provided me with this code to integrate into the website.

I’m trying to get it to trigger with a button element. I’ve tried using class ID, but no luck. I found an old support topic from another client (https://theme.co/apex/forums/topic/adding-script-to-page-in-cornerstone/), but that didn’t help me too much. I’d appreciate any advice!

Hi Sean,

Thanks for writing in! Could you please provide any links to their documentation to see what you need to integrate or share any sample code (you can use https://pastebin.com/) to see the possibility.

Also check the following example and see if that helps (https://theme.co/apex/forum/t/getting-button-to-launch-java-code-for-popup-checkout/45881/2?u=mldarshana).

Thanks!

I apologize. I meant to include the code. Here it is: https://pastebin.com/11A26b4f

Hi Sean,

Thanks for reaching out.

That’s just an embed code and not related to any click event. If you’re referring of capturing the output generated by that code then it’s only possible custom development which we can’t cover. Plus, it creates it directly (document.createElement('script');, document.createElement('link')) so it might not possible either.

I recommend contacting the author of that code to see if that’s possible. But based on that code, it’s only trigger upon page load and not by click.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.