You need to sign in to do that
Don't have an account?
Alessandro Zucca
Live Agent init(), disconnect() and init()
Should liveagent.disconnect(), allow then to re-initialise the chat?
From what I can see this is prevented by the fact that a "qa" variable (obfuscated code) is set to 0 during initialization
var v = f.getCookie("liveagent_sid") , $ = f.getCookie("liveagent_chatted") , qa = !1 , Q = !1 , k = {}
and then the function that handles the button visibility (and more) does not get executed as qa is
function O() {
if (!qa) {
qa = !0;
f.log("DOM is ready. Setting up environment.");
null == u.getOref() && u.setOref(document.referrer); null == u.getVisitCount() && u.setVisitCount(1); if (window._laq) for (var a = 0; a < window._laq.length; a++) window._laq[a].call(window); q.connection.setCallback("liveagent._.handlePing"); ra()
}
}
why liveagent.disconnect() does not reset that 'qa' variable to the default and allow us to make a "re"- init() ?
I came across this problem, as the button that displays the livechat link in our application is inside a dialog, therefore the first time I open the dialog the button appears correcty.
The second time it doesn't for the issue highlighed above
From what I can see this is prevented by the fact that a "qa" variable (obfuscated code) is set to 0 during initialization
var v = f.getCookie("liveagent_sid") , $ = f.getCookie("liveagent_chatted") , qa = !1 , Q = !1 , k = {}
and then the function that handles the button visibility (and more) does not get executed as qa is
function O() {
if (!qa) {
qa = !0;
f.log("DOM is ready. Setting up environment.");
null == u.getOref() && u.setOref(document.referrer); null == u.getVisitCount() && u.setVisitCount(1); if (window._laq) for (var a = 0; a < window._laq.length; a++) window._laq[a].call(window); q.connection.setCallback("liveagent._.handlePing"); ra()
}
}
why liveagent.disconnect() does not reset that 'qa' variable to the default and allow us to make a "re"- init() ?
I came across this problem, as the button that displays the livechat link in our application is inside a dialog, therefore the first time I open the dialog the button appears correcty.
The second time it doesn't for the issue highlighed above
- Start an initial chat
- Complete the initial chat
- Re-open chat with a new case
All without refreshing the page?My goal is to have a live chat button on a dialog window (Ext JS) and being able to close the dialog window, re-opening it and have the livechat agent showing the button again, without having to refresh the page.
At the moment, I assume the liveagent lose the reference to the button elements as the Ext JS possibly removes the buttons from the DOM when the dialog windows is closed therefore when the dialog window is re-opened the liveagent can't show the button
The second time the dialog window is opened, if I run in the console, liveagent.disconnect(), and then run liveagent.init(...) with a breakpoint in if (!qa) and setting qa = 0 when it stops the execution, this makes the button again.
$.getScript( "/agent-34.0.js", function( data, textStatus, jqxhr ) {});
here's my sample code
Thanks and Regards,
delete liveagent removes that object complete, then I was digging around in the deployment.js and discovered liveAgentDeployment. It hangs around and keeps you from rebuilding liveagent on the page. After running this, I rerun the liveagent.showWhenOnline, and liveagent.init and I can do this as many times as I want before leaving a page.
But if you only delete global liveagent-objects using Glen Barger's method,
you may get js error s if there was still a pending network request that returns after you deleted liveAgent.
(if you always reload liveagent after deleting it, it may happens less often)
To supress these occasional errors, this worked for me.: