• D_Kelly
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi,

 

Part of a project we are working on is deploying Live Agent. Part of Live Agent is the ability to add a button to a page that indicates if a Live Agent user has logged in and is available to chat, The button renders one message if its available and another if not. This is great and works well when we added to a home page in a customer portal setup.

 

However, when we added the code to a VisualForce page, the button would not work! Does anybody have experience with using this button code in a VF page? The VF page we are using is a sites page and is publicly available. The code is below, there are two sections to it.

 

<!-- START Salesforce Live Agent Deployment Code: MUST BE PLACED DIRECTLY ABOVE THE CLOSING </BODY> TAG and AFTER/OUTSIDE ALL HTML -->
<script type="text/javascript">
var __ALC_Deployment = 9702;
document.write(unescape("%3Cscript src='"+document.location.protocol+"//depot.liveagentforsalesforce.com/app/js/lt.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- END Salesforce Live Agent Deployment Code -->


And this is the code for the buttons:



<!-- START Salesforce Live Agent Button/Link Code: Place this code into your HTML wherever you want this button/link to appear -->
<script type="text/javascript">
var __ALC_BADGE_SUFFIX = (Math.round(Math.random()*10000000000));
document.write('<div id="__ALC_BADGE_ONLINE'+__ALC_BADGE_SUFFIX+'" style="display: none;"><a href="javascript&colon;//chat" onclick="_alc.startChat(14885); return false;"><img id="__ALC_BADGE_ONLINE_IMAGE" style="border: 0px none" src="'+unescape(document.location.protocol+'//depot.liveagentforsalesforce.com/app/chat/buttons/97/btn3_grn2_on.gif')+'" /></a></div><div id="__ALC_BADGE_OFFLINE'+__ALC_BADGE_SUFFIX+'" style="display: none;"><a href="http://www.city-link.com"><img id="__ALC_BADGE_OFFLINE_IMAGE" style="border: 0px none" src="'+unescape(document.location.protocol+'//depot.liveagentforsalesforce.com/app/chat/buttons/97/btn3_grn2_off.gif')+'" /></a></div>');
if ( typeof(__ALC_Badges) == 'undefined' ) __ALC_Badges = new Array();
var __ALC_BUTTON = new Object(); __ALC_BUTTON.id = '14885'; __ALC_BUTTON.available = '__ALC_BADGE_ONLINE'+__ALC_BADGE_SUFFIX; __ALC_BUTTON.unavailable = '__ALC_BADGE_OFFLINE'+__ALC_BADGE_SUFFIX; __ALC_BUTTON.department = 0; __ALC_Badges.push(__ALC_BUTTON);
</script>
<!-- END Salesforce Live Agent Button/Link Code -->