Skip to content
Advertisement

Open third party Live chat on the same page without opening a separate window

Target Environment: WordPress VIP header.php

goal: click icon div to open third party chat, toggle to close if needed, chat icon to persist acrross all pages.

Hi All

I’ve been tasked with integrating a 3rd Party Chat app in our site. I want it to perform like a traditional chat in-page chat app (in a div) , however, the shared script uses js the window.open method and open the chat into a separate window. I’ve tried unsuccefully to use , tags. Suspect this shouldnt be to hard but I can’t figure it out. I hope I have enough information here.

Thanks in advance! The code I am replacing is straight forward yet opens into a new window but I need the window to look like a modern chat

JavaScript

My attempt:

JavaScript

Here is how I want the chat to look : Goal Chat Window

Advertisement

Answer

No idea why you are over complicating this. is there a specific reason you want to load the iframe after? if not using css to style it and just toggling it to be visible is the best solution.

HTML

JavaScript

CSS

JavaScript

JavaScript

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement