function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC coderSFDC coder 

Unable to chat with live agent in salesforce

I have created a force.com site and have added the deployment script as well as the code for buttons into my sites homepage
But when i click on my button the chat window pops up with an error as:

HTTP ERROR: 500

Problem accessing /content/s/prechatVisitor. Reason:

    This is not a JSON Array.
Powered by Jetty://
Denis VakulishinDenis Vakulishin
Could you post here the code logic of the button ?
SFDC coderSFDC coder
<apex:page standardController="Product2" extensions="SearchExt,EmailServiceExt" recordSetVar="lists" sidebar="false" showHeader="false">

//This is my deployment script
<script type='text/javascript' src='https://c.la1t1.salesforceliveagent.com/content/g/js/31.0/deployment.js'></script>
<script type='text/javascript'>
liveagent.init('https://d.la1t1.salesforceliveagent.com/chat', '572900000000Ego', '00D90000000qEai');
</script>

//This is the code for button
<img id="liveagent_button_online_573900000000F3Y" style="display: none; border: 0px none; cursor: pointer" onclick="liveagent.startChat('573900000000F3Y')" src="https://acmerealestate-developer-edition.ap1.force.com/resource/1405665718000/OnlineIcon" /><img id="liveagent_button_offline_573900000000F3Y" style="display: none; border: 0px none; " src="https://acmerealestate-developer-edition.ap1.force.com/resource/1405663898000/OfflineIcon" />
<script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('573900000000F3Y', document.getElementById('liveagent_button_online_573900000000F3Y'));
liveagent.showWhenOffline('573900000000F3Y', document.getElementById('liveagent_button_offline_573900000000F3Y'));
});</script>

</apex:page>
Thanks,
Neha Patil
Denis VakulishinDenis Vakulishin
Hi, 
It seems like there's an error in SF live chat or your configuration of it. I think that you should ask live chat support for help.

Regards,
Denis Vakulishin
SFDC coderSFDC coder
hi,

May i know how to reach to live chat support team?

Thanks,
Neha Patil
Li ChenLi Chen
Hi Neha,
I'm also facing same issue, have you find the root cause and solution? Thanks
John SJohn S
This is likely the same issue mentioned here: http://stackoverflow.com/questions/710586/json-stringify-array-bizarreness-with-prototype-js

This code can be placed somewhere above/before the liveagent.init call.

<script type="text/javascript> 
    if(window.Prototype) {
        delete Object.prototype.toJSON;
        delete Array.prototype.toJSON;
        delete Hash.prototype.toJSON;
        delete String.prototype.toJSON;
    }
</script>
Li ChenLi Chen
Hi John,
It's really help and solve our issue!! after adding on additional script, the Live Agent client page is working fine