Genesys CTI User Forum > Genesys-related Development
Genesys Widgets - Chat
René:
Incorrect order - widgets.min.js should be loaded after configuration script
GoodONE:
Ok thanks, it did not work,
I have this other script, I found it in the docs, but it is still not working, Do you see something wrong with it?
[code]<!DOCTYPE html>
<html>
<title>Service</title>
<script>
(function(o){
var d = o.location;
var f = function(){
o.aTags = o.aTags || [];
for(var i=0;i<o.aTags.length;i++){
var oTag = o.aTags[i];
var fs = d.getElementsByTagName(oTag.type)[0], e;
if(d.getElementById(oTag.id)) return; e = d.createElement(oTag.type); e.id = oTag.id;
if(oTag.type == "script"){
e.src = oTag.path;
}else{
e.type = 'text/css';e.rel = 'stylesheet';e.href = oTag.path;
}
fs.parentNode.insertBefore(e, fs);
}
},ol = window.onload,showConfigData = function(){
// remote script has loaded, this is to show the config script on text area of launcher
d.getElementsByName('configData')[0].disabled = false;
d.getElementsByName('configData')[0].value = "window._genesys.widgets = " + JSON.stringify(window._genesys.widgets, undefined, 6).replace(/\"([^(\")"]+)\":/g,"$1:")+";";
};
if(o.onload){typeof window.onload != "function"?window.onload=f:window.onload=function(){ol();f();
showConfigData();}}else {f();showConfigData();};
})({location: document,
onload: false,
aTags: [{type:"script", id:"genesys-widgets-script", path:"/chattest/widgets.min.js"},
{type:"link", id:"genesys-widgets-styles", path:"/chattest/widgets.min.css"}]});
</script>
<body>
<a href="/chattest/Sales.html">Sales</a>
<hr />
<a href="/chattest/Launcher.html">Launcher</a>
</body>
</html>[/code]
cavagnaro:
Please, read the whole documentation before trying to play with it. The docs are complementary.
You are missing this:
https://docs.genesys.com/Documentation/GWC/latest/Deployment/GWCConfig
GoodONE:
Thanks it is now working!.
Another question,
Do you know if by using this when the user moves to other page the chat session should be alived with the same chat history?
Sones:
I would certainly hope that this was the case, GoodONE. If not, it would be on my wishlist for sure! Otherwise, great functionality.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version