0

Is there a concise/elegant way to check if a live agent is available? I'd like to show certain elements depending on whether or not an agent is available. The closest thing I found so far was this, but its from 3 years ago so I'm not sure if it's still up to date, or if there exists a better way of doing so.

2

1 Answer 1

1

There is an example in the chat button code that does that for you.

if (!window._laq) { window._laq = []; }
window._laq.push(function(){
liveagent.showWhenOnline('<Chat Button Id Here>', document.getElementById('<Online Element Id Here>'));
liveagent.showWhenOffline('<Chat Button Id Here>', document.getElementById('<Offline Element Id Here>'));
});
2
  • What library loads in ._laq and the liveagent object?
    – ROODAY
    Commented Jun 19, 2017 at 14:45
  • There is code you need to copy from the Deployment as well. Commented Jun 20, 2017 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .