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?

  • Can you write onlclick event in your button to close popup like onclick="window.close()"? – Raul Mar 7 '17 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 '17 at 20:14
  • Oh that sucks ! – Raul Mar 13 '17 at 20:18

"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(){

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.