Freshchat Demo

Deme to open Freshchat on a hyperlink select.

by Paul Leech

HTML

<a id="open_fc_widget" onClick="openWidget()" style="cursor:pointer;">Contact us</a>
<div id="fc_frame">
</div>
<script src="https://wchat.freshchat.com/js/widget.js" async></script>
<script>
  window.fcSettings = {
    token: "fa5ad5f8-83be-4401-addd-f75b8cd84e53",
    host: "https://wchat.freshchat.com",
    onInit: function() {
    	window.fcWidget.on("widget:closed", function() {
        console.log('widget was closed');
        document.getElementById('fc_frame').style.display = 'none';
      });
    }
  };
</script>
<script>
var openWidget = function() {
  document.getElementById('fc_frame').style.display = 'block';
  window.fcWidget.open();
};
      
jQuery(document).ready(function() {
  document.getElementById('fc_frame').style.display = 'none';
});
</script>

CSS

#fc_frame {
  display: none;
}