Developer APIs
GuidesProductUpdatesPricingFAQs
  • API Docs & Reference
  • REST API
    • Introduction
    • Agents
    • Chats
    • Offline Messages
    • Visitors
  • JavaScript API
    • Introduction
    • Chat Form
    • User Data & Logout Info Update
    • Chat Button
    • Click To Call Action
    • Language
    • Department
    • Event Listener
Powered by GitBook
On this page
  • Open Chat Window
  • How to maximize the widget when visitor comes to a webpage?
  • Close Chat

Was this helpful?

  1. JavaScript API

Chat Button

Using Button API Developer can launch Pre-Chat form or offline message form on clicking any button or hyperlink of any website.

DEFINITION
$_REVECHAT_API(function(){ … });

Table

Method
Description

maximize

Launch pre-chat or offline message form

Open Chat Window

DEFINITION
function maximize() 
launch pre-chat window or offline message window on clicking on any link , button or hyperlink.
Paste following code snippet into webpage to maximize the chat widget

<a href="javascript:void($_REVECHAT_API && $_REVECHAT_API['Button'] &&$_REVECHAT_API.Button.maximize())">chat with us</a>
Paste following code snippet into webpage to minimize the chat widget

<a href="javascript:void($_REVECHAT_API && $_REVECHAT_API['Button'] &&$_REVECHAT_API.Button.minimize())">chat with us</a>
Paste following code snippet into webpage to hide the chat button

<a href="javascript:void($_REVECHAT_API && $_REVECHAT_API['Button'] &&$_REVECHAT_API.Button.hide())">chat with us</a>
Paste following code snippet into webpage to show the chat button

<a href="javascript:void($_REVECHAT_API && $_REVECHAT_API['Button'] &&$_REVECHAT_API.Button.show())">chat with us</a>

How to maximize the widget when visitor comes to a webpage?

<!-- Start of REVE Chat Script-->
<script type='text/javascript'>

 
 window.$_REVECHAT_API || (function(d, w) { var r = $_REVECHAT_API = function(c) {r._.push(c);}; w.__revechat_account="7577903";w.__revechat_version=2;
	  r._= []; var rc = d.createElement('script'); rc.type = 'text/javascript'; rc.async = true; rc.setAttribute('charset', 'utf-8');
	  rc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.revechat.com/widget/scripts/new-livechat.js?'+new Date().getTime();
	  var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(rc, s);
	})(document, window);
	
 
 $_REVECHAT_API(function()
 {
	   setTimeout(function(){
         $_REVECHAT_API.Button.maximizeV2();
     }, 1000);

 });

</script>
<!-- End of REVE Chat Script -->

Close Chat

Paste following code snippet to close chat

<script type='text/javascript'>
 window.$_REVECHAT_API || (function(d, w) { var r = $_REVECHAT_API = function(c) {r._.push(c);}; w.__revechat_account='12-12-12-12';w.__revechat_version=2;
   r._= []; var rc = d.createElement('script'); rc.type = 'text/javascript'; rc.async = true; rc.setAttribute('charset', 'utf-8');
   rc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.revechat.com/co-browsing/new-livechat.sjs?'+new Date().getTime();
   var s = d.getElementsByTagName('script')[0]; s.parentNode.insertBefore(rc, s);
 })(document, window);
</script>
 
<a href="javascript:void($_REVECHAT_API && $_REVECHAT_API.Form.Online.closeChat()">close chat</a>

PreviousUser Data & Logout Info UpdateNextClick To Call Action

Last updated 6 months ago

Was this helpful?

Any questions? Please email us at

support@revechat.com