Online
Offline Chat Content
 ", "upvoteCount": 4, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4V0JSAV", "datePublished": "2016-02-24T21:05:51.000Z", "author": { "@type": "Person", "name": "Nikhil Sharma", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000CTaKuAAL", "affiliation": { "@type": "Organization", "name": "Tata Consultancy Services" } } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Hi Eric, Instead of iframe id pass the name. It will work definitely.", "upvoteCount": 3, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4V0JSAV", "datePublished": "2016-02-24T21:10:35.000Z", "author": { "@type": "Person", "name": "Nikhil Sharma", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000CTaKuAAL", "affiliation": { "@type": "Organization", "name": "Tata Consultancy Services" } } } ] } }
Skip to main content
Hi,

I am able to integrate the live agent into my app, but it always pop up a new window. I am trying to make it display in an iframe within the page to avoid a pop up window. I have look into liveagent.startChatWithWindow(), but I couldn't get it to work when I pass the iframe id as parameter to the function. Is it possible to do that? Thanks!
7 answers
  1. Feb 24, 2016, 9:05 PM

    You have to just take an iframe and passed the name of the iframe to startchatwithwindow

    <iframe name="myiframe" style="height:300px;">

    Here we show the chat window.

    </iframe>

    <script type='text/javascript' src='https://c.la10.salesforceliveagent.com/content/g/js/36.0/deployment.js'></script>

    <script type='text/javascript'>

    liveagent.init('https://d.la10.salesforceliveagent.com/chat', '57228000000PBN5', '00D280000019WTn');

    </script>

    <a id="liveagent_button_online_57328000000PBP1" href="javascript://Chat" style="display: Block;" onclick="liveagent.startChatWithWindow('57328000000PBP1','myiframe')"> Online </a><div id="liveagent_button_offline_57328000000PBP1" style="display: block;"> Offline Chat Content</div><script type="text/javascript">

    if (!window._laq) { window._laq = []; }

    window._laq.push(function(){liveagent.showWhenOnline('57328000000PBP1', document.getElementById('liveagent_button_online_57328000000PBP1'));

    liveagent.showWhenOffline('57328000000PBP1', document.getElementById('liveagent_button_offline_57328000000PBP1'));

    });</script>

     
0/9000