<div id="dchat"></div> <a id="pcstopchat" href="#">stop chat</a>
//Next line is to prevent errors in IE while logging to console if ( ! window.console ) console = { log: function(){} }; var pcclient; $(document).ready(function(){ pcclient = $('#dchat').pcclient({ targetName: 'pushcall', clientType: 'chat', locale: 'nl', forceHTML: true, eventCallback: function (event, eventData) { console.log("eventCallback: %o %o", event, eventData); } }); $('#pcstopchat').bind('click', function(){ if(pcclient) pcclient.stopChat(); }); });
#dchat { width:500px; height: 500px; }