2

Here's my code:

<div id="liveagent_invite_button_5733B00000000DZ" style="display: none;
                                                         position: fixed; border: 2px solid darkblue; border-radius: 5px;
                                                         background-color: lightblue; height: 100px; width: 200px;">
    <div style="cursor: pointer; padding: 5px; right: 0px;
                position: absolute; color: darkred; font-weight: bold;"
         onclick="liveagent.rejectChat('5733B00000000DZ')">X</div>
    <div style="cursor: pointer; top: 42px; left: 65px; position: absolute;
                font-weight: bold; font-size: 16px;" 
         onclick="liveagent.startChat('5733B00000000DZ')">Start Chat</div>
</div>

<script type='text/javascript'
src='https://c.la1-c1cs-dfw.salesforceliveagent.com/content/g/js/39.0/deployment.js'>
    </script>
<script type='text/javascript'>
function buttonCallback(e) {
    if (e == liveagent.BUTTON_EVENT.BUTTON_AVAILABLE) {
        document.getElementById('liveagent_invite_button_5733B00000000DZ').style.display 
        = '';
        document.getElementById('liveagent_invite_button_5733B00000000DZ').style.left = 
            '300px';
        document.getElementById('liveagent_invite_button_5733B00000000DZ').style.top = 
            '200px';
    }
    if (e == liveagent.BUTTON_EVENT.BUTTON_UNAVAILABLE) {
        document.getElementById('liveagent_invite_button_5733B00000000DZ').style.display =
            'none';
    }
    if (e == liveagent.BUTTON_EVENT.BUTTON_ACCEPTED) {
        document.getElementById('liveagent_invite_button_5733B00000000DZ').style.display =
            'none';
    }
    if (e == liveagent.BUTTON_EVENT.BUTTON_REJECTED) {
        document.getElementById('liveagent_invite_button_5733B00000000DZ').style.display =
            'none';
    }
}
liveagent.addButtonEventHandler('5733B00000000DZ', buttonCallback);
liveagent.init('https://d.la1-c1cs-dfw.salesforceliveagent.com/chat', '5723B000000CaUz',
               '00D3B0000008uir');
</script>

Any ideas?

4
  • 1
    Hey Rob! Did you check the console for any errors? – Adrian Larson Apr 14 '17 at 3:59
  • Hi, Adrian! It's now working at home. It wasn't working earlier at the office. I'll have to see if it works at the office tomorrow. – Rob Alexander Apr 14 '17 at 4:31
  • 1
    Rob, check for the html/js of the hosted page. Typically, if there is some sort of conflict the automatuon invitation doesn't tend to show up. – mubs Apr 14 '17 at 5:23
  • It's working at the office now. I'm not sure what's different from yesterday. – Rob Alexander Apr 14 '17 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.