• Han Dao
  • NEWBIE
  • 0 Points
  • Member since 2014

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

I'm putting together a community site using one of the new Winter '15 templates and looking to add a chat button/link that routes to a pre-chat form.  I've configured/generated the following live agent deployment and button code (IDs replaced with '*') and dropped it into an html element of the community: 

<a id="liveagent_button_online_***************" href="javascript://Chat" onclick="liveagent.startChat('***************')">Click here to chat with us!</a>
<div id="liveagent_button_offline_***************" style="display: none;">No agents are currently available.</div>
<script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('***************', document.getElementById('liveagent_button_online_***************'));
liveagent.showWhenOffline('***************', document.getElementById('liveagent_button_offline_***************'));
});
</script>
    
<script type='text/javascript' src='https://c.la3-c1-was.salesforceliveagent.com/content/g/js/31.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la3-c1-was.salesforceliveagent.com/chat', '***************', '***************');
</script>

I've tried this same code on a community page created from a custom Site.com template, and it works just fine.  When I use it on the community template, the link doesn't seem to recognize whether a chat agent is online, so it always displays the available message.  Also, when I click on the link, I get the message "Uncaught TypeError: Cannot read propert 'startChat' of undefined" using the Chrome console.

Any help would be greatly appreciated!
Hi all,

I'm putting together a community site using one of the new Winter '15 templates and looking to add a chat button/link that routes to a pre-chat form.  I've configured/generated the following live agent deployment and button code (IDs replaced with '*') and dropped it into an html element of the community: 

<a id="liveagent_button_online_***************" href="javascript://Chat" onclick="liveagent.startChat('***************')">Click here to chat with us!</a>
<div id="liveagent_button_offline_***************" style="display: none;">No agents are currently available.</div>
<script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('***************', document.getElementById('liveagent_button_online_***************'));
liveagent.showWhenOffline('***************', document.getElementById('liveagent_button_offline_***************'));
});
</script>
    
<script type='text/javascript' src='https://c.la3-c1-was.salesforceliveagent.com/content/g/js/31.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la3-c1-was.salesforceliveagent.com/chat', '***************', '***************');
</script>

I've tried this same code on a community page created from a custom Site.com template, and it works just fine.  When I use it on the community template, the link doesn't seem to recognize whether a chat agent is online, so it always displays the available message.  Also, when I click on the link, I get the message "Uncaught TypeError: Cannot read propert 'startChat' of undefined" using the Chrome console.

Any help would be greatly appreciated!