Live Helper Chat support forum.. Old google groups forum can be found here

You are not logged in.

Announcement

#1 2021-02-05 15:35:45

iwmike
New member
Registered: 2021-02-05
Posts: 2

Could an unescaped single quote kill the "not available" message?

Hi

We've migrated a customer over from a designer who originally integrated livehelperchat. We have very little experience ourselves. I believe that we had everything working for a while, but the 'chat with us' link no longer works. In the browser console I can see:

1:9 Uncaught SyntaxError: Unexpected identifier

And this appears to be because of the js line:

var location  = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : '';

That line seems to load a script that chokes on the below:

document.getElementById('lhc_status_container').innerHTML = '<p><a href="#" onclick="return lh_inst.lh_openchatWindow()">'+(this.isOnline == true ? '<img src="//meganbakerestateagents.com/chat/var/storagetheme/2015y/10/23/1/65278d0fc2bacdedf54eff29e0160753.png" alt="" />Fancy a chat? We're online so get in touch and we'll see how we can help.' : '<img src="//<<customerurl>>/chat/var/storagetheme/2015y/10/23/1/8cfe4396b112a883c8e7a8026093e5a5.png" alt="" /> Sorry, we're not available at the moment. Please leave us a message and we'll get straight back to you.')+'</a></p>';

If I understand it right, the two single quotes in "Sorry, we're not available at the moment. Please leave us a message and we'll get straight back to you." should be escaped, and because they're not escaped the string concatenation starting at innerHTML = '<p><a href="#" is malformed.


I assumed that if this is the problem, the not available message would have  been customer-defined, so I'd just need to escape it. But when I check under Home...System configuration...Canned messages, I don't see that message defined.

Is there a place I can changed that message to hopefully fix this issue?

Thanks

Mike

Offline

#2 2021-02-05 15:47:39

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,507
Website

Re: Could an unescaped single quote kill the "not available" message?

Hi,

Migrate to a new widget embed code and all will be working. Old widget is not longer maitained.

If you have very old version you might need to update.

Offline

#3 2021-02-05 16:00:40

iwmike
New member
Registered: 2021-02-05
Posts: 2

Re: Could an unescaped single quote kill the "not available" message?

Awesome! thank you, that works a treat

Offline

Board footer