Customers
User information
 Loading ...
Show article in Knowledge Base

 Support chat in pop‑up Export knowledge base Export     SubscribeSubscribe      Show article info

If you want to link to the chat from another site than your Support Center (maybe the company website) you should use this option.

 

Including chat in pop-up.

 

1. In the simplest form just include a link (Change locale, supportCenterCode and host to correct values). 

 

<a href  onClick="window.open('http://www.visionproject.se/SupportChatRequest.do?supportCenterCode=8USa0ec8CyGSgfbfPTSV&locale=sv_SE', 770, 600);"/>Chat</a>

 

 

 

2.  But you probably want to check if the Support chat is open. So then we add this line on the top of the page.

Again change to correct values for support center code and host. 

<script type="text/javascript" src="http://www.visionproject.se/CheckSupportChat.do?supportCenterCode=8USa0ec8CyGSgfbfPTSV"></script>

 

 

After this script is added to the page a javascript object is available where you can check if the Suppport chat is open.

You can therfore do something like:  

 

function chatCheck() {   
    if (statusObj.isOpen) { 
          // chat is open       
   }        
  else {  
	// chat is closed     
  }   
}  

 

 

 

 

3. Now let's put it together in a more complete example.

This example shows a online image if the support chat is open.

Again change supportCenterCode, locale and host to correct value. 

 

<html>
<head>
<!-- Script that checks if chat is open -->
<script type="text/javascript" src="http://www.visionproject.se/CheckSupportChat.do?supportCenterCode=8USa0ec8CyGSgfbfPTSV"></script>

 

<!-- Here you do different things depending on if the chat is open or not -->

<script>
 function initChatCheck() {
   if (statusObj.isOpen) { 
  // chat is open. Display link. 
  document.getElementById("chatLink").style.display = 'block';
   } 
  else {
           // Chat is closed. Show a offline Image. In this case do not show the link. 
  }
}

   // This function open the Pop-up in the middle of the page

// Adjust to your needs  
 
 function wopen(url, w, h) {  
     var wleft = (screen.width - w) / 2;      
  var wtop = (screen.height - h) / 2;      
  var win = window.open(url, "", 'width=' + w  + ', height=' +  h + ', ' + 'left=' + wleft + ', top=' + wtop + ', ' +                'location=no, menubar=no, ' +                 'status=no, toolbar=no,  scrollbars=no, resizable=yes');  
       win.focus();}

  </script>

</head>
<!-- Wait until the DOM is loaded before changing DOM -->
 
<body onLoad="initChatCheck()">

    <!-- Change URL, Support center code  etc . This is just an example. Feel free to use own images etc  -->

<div id="chatLink" style="display:none"><img src="http://www.visionproject.se/chat/images/supportChatOpen.jpg"   onClick="wopen('http://www.visionproject.se/SupportChatRequest.do?supportCenterCode=8USa0ec8CyGSgfbfPTSV&locale=sv_SE', 770, 600);
return false;"/>
</div>
</body>
<html>

User comments
 Loading ...