0

I have placed the Live Chat into an iFrame and the chat functionality works. Unfortunately, when I click the 'cancel chat' button, the chat ends, but the iFrame is still visible.

Is there a way to make 'cancel chat' button close the iFrame, as it does when the chat is in a pop up?

3
  • Can you write onlclick event in your button to close popup like onclick="window.close()"?
    – Raul
    Mar 7, 2017 at 13:58
  • Unfortunately this does not work, as the Live Agent chat window with the 'Cancle chat button' is delivered by SalesForce.
    – TomekLach
    Mar 13, 2017 at 20:14
  • Oh that sucks !
    – Raul
    Mar 13, 2017 at 20:18

1 Answer 1

-1

"Closing" the current iFrame is not possible but you can tell the parent to manipulate the dom and make it invisible.

In IFrame:

parent.closeIFrame(); //Call this method onclick on Close Chat button

In parent:

function closeIFrame(){
     $('#youriframeid').remove();
 }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .