Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Talk discussion resolved

...

In the current example, the onWidgetReady function is defined on the page before the code of the widget. The function name is specified in the data attribute of the script used for loading a widget (data-on-ready="onWidgetReady"). After initialization of the widget, the onWidgetReady function will be called, which will lead to the opening of the widget and its closing after 10 seconds. Talk

idtalk-4054

Code Block
<!DOCTYPE html>
<html>
<body>
<h1>My page with Customer Case Widget</h1>
<script>
    function onWidgetReady(invertState) {
        invertState();
        setTimeout(invertState, 10000);
    }
</script>

<script data-cc-embedded data-key="ee8f9393-42da-41d1-93ad-205d44e5181e" 
data-base-url="https://ac.customercase.com" 
data-on-ready="onWidgetReady" 
src="https://ac.customercase.com/assets/embed.js"> </script>
</body>
</html>

...