G2 Crowd User in Computer Software

How to insert the widget into a webpage?

over 2 years ago

Inserting the widget into a webpage

Vendor Responses

Response by OnOp - Online Operator

over 1 year ago

It is necessary to edit source code of a destination webpage.

Code:

<script type="text/javascript">

(function () {

var scr = document.createElement('script'); scr.type = 'text/javascript'; scr.async = true; scr.charset = 'UTF-8';

scr.src = 'https://oo1.applicloud/embed/OOWidget.js';

scr.$ooOnLoad = function () {

if (!$oo.isSupported) { return; }

$oo.setConnectionId("295b1064-cf5b-4a5d-9e05-e7a74f86ae5e", 0);

$oo.setCustomData({});

$oo.connectToServer();

$oo.renderWidget("chat");

};

var ffs = document.getElementsByTagName('script')[0]; ffs.parentNode.insertBefore(scr, ffs);

})();

</script>

This code should be inserted into <head> or <body> element of the webpage. In case of CMS systems the situation can be a bit more complicated; however this procedure should work in most of the cases. Exact location of the code does not influence location of the widget. Script requires usage of window.onload.