Chat control via JavaScript - methods for opening, hiding, and creating chat from JS
Api instruction
RestAPI Webhooks - live chat integration with your system Dynamic content change in triggers How to automatically insert into the chat the login and email of users? Chat control via JavaScript - methods for opening, hiding, and creating chat from JS Assigning consultants to clients How to open the selected chat department?
Chat control via JavaScript.
Proper modification of the code allows controlling the chat via JavaScript. Thus, you can for example prevent chat generation when the page is loading, which is very useful, especially for websites where content is loaded dynamically.How to do this?
First, we need to add to our code:not_auto_create: true
After this modification, the code will look like this:

Then, it is time to properly control the chat via JavaScript by calling appropriate global functions, depending on the effect we want to achieve:
- to generate chat, you need to call a global function:
czaterMethods.main();
- to destroy the chat, you need to call a global function:
destroy();
- to show the chat automatically, you need to call a global function:
$czaterMethods.showChat();
- to hide the chat you need to call a global function:
$czaterMethods.hideChat()
-to show window callback, you need to call a global function:
$czaterMethods.toggleCallBanner(true)
-to hide window callback, you need to call a global function:
$czaterMethods.toggleCallBanner(false)
Your comment will be added after moderation