[SalesForce] Live Agent popup window

I am having difficulties with Live Agent to set it up on a custom third party website that is not connected with force.com.
Problem: Whenever i press the button for online talk it popup a new window for chatting with the agent. All i want is to have that window in the same previous window that i had before. Is that possible ?
I am sorry if i didn't wrote this topic well. I am new to this 🙂

Here is my code:

<div id="liveagent_invite_button_57320000000L0oF" style="display:none; position: fixed; border: 2px solid darkblue; border-radius: 5px;
background-color: lightblue; height: 200px; width: 400px;">
<h5>Customer Service</h5>
<p>
Hello, and welcome to our customer service page.<br/>
Please click the link to begin a live chat session:<br/>
<img id="liveagent_button_online_57320000000L0oA" style="display: none; border: 0px none; cursor: pointer" target="_top" onclick="liveagent.startChat('57320000000L0oA')" src="https://inplayer.secure.force.com/inplayer/resource/1412841786000/OnlineChatButtonLiveAgent" /><img id="liveagent_button_offline_57320000000L0oA" style="display: none; border: 0px none; " src="https://inplayer.secure.force.com/inplayer/resource/1412841829000/OfflineChatButtonLiveAgent" />
</div>
<script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('57320000000L0oA', document.getElementById('liveagent_button_online_57320000000L0oA'));
liveagent.showWhenOffline('57320000000L0oA', document.getElementById('liveagent_button_offline_57320000000L0oA'));
});</script>

<script type='text/javascript' src='https://c.la2w2.salesforceliveagent.com/content/g/js/31.0/deployment.js'></script>
<script type='text/javascript'>
function buttonCallback(e) {
if (e == liveagent.BUTTON_EVENT.BUTTON_AVAILABLE) {
document.getElementById('liveagent_invite_button_573x0000000001O').style.display
= '';
document.getElementById('liveagent_invite_button_573x0000000001O').style.left =
'300px';
document.getElementById('liveagent_invite_button_573x0000000001O').style.top =
'200px';
}
if (e == liveagent.BUTTON_EVENT.BUTTON_UNAVAILABLE) {
document.getElementById('liveagent_invite_button_573x0000000001O').style.display =
'none';
}
if (e == liveagent.BUTTON_EVENT.BUTTON_ACCEPTED) {
document.getElementById('liveagent_invite_button_573x0000000001O').style.display =
'none';
}
if (e == liveagent.BUTTON_EVENT.BUTTON_REJECTED) {
document.getElementById('liveagent_invite_button_573x0000000001O').style.display =
'none';
}
}
liveagent.addButtonEventHandler('573x0000000001O', buttonCallback);
liveagent.init('https://d.la2w2.salesforceliveagent.com/chat', '57220000000Kzza', 'liveagent_invite_button_57320000000L0oF');
</script>

Best Answer

Try using the method startChatWithWindow

    liveagent.startChatWithWindow('yourbuttonid','yourwindowname')"

<script type='text/javascript'>
window.name = "myWindowName";
liveagent.init('https://d.la2cs.salesforceliveagent.com/chat', '57450000000KzGr', '00DR0000001tYzY');
</script>
Related Topic