", "answerCount": 4, "upvoteCount": 0, "datePublished": "2015-01-16T05:56:28.000Z", "author": { "@type": "Person", "name": "Li Chen", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000A7w4MAAR", "affiliation": { "@type": "Organization", "name": "--" } }, "acceptedAnswer": { "@type": "Answer", "text": "There's a comment from another discussion really help to solve the problem: https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AdVQ Below code can be placed somewhere above/before the liveagent.init call. After added this code, the Live agent client page is working fine for most of browsers. For IE9, it requires additional configuration in IE9 broswer:  1. Turn off the \"compatibility mode\" for all the sites 2. Add *. salesforceliveagent.com into Intranet Site 3. Enable \"Running Script\"", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4KZJSA3", "datePublished": "2015-02-11T02:22:06.000Z", "author": { "@type": "Person", "name": "Li Chen", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000A7w4MAAR", "affiliation": { "@type": "Organization", "name": "--" } } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Hi Li, i have the same issue of you. I cannot understand how you use your code. Is it possible you did something like:   Skip to main content
Hi All,

We are implement Live Agent feature and configure skill and users, and tried to integrate with our own web-portal.

By Running sample script genereated by Salesforce from Local laptop, it's working well, can see online/offline of agents, also can do Live chat with agents.

When we deploy to our own Tomcat-Apache web-server, we are able to see the online/offline button, but after i click on the Online button the chat window pops up with an error as below:

HTTP ERROR: 500

Problem accessing /content/s/prechatVisitor. Reason:

This is not a JSON Array.

Powered by Jetty://

And URL call in browser looks like below strang url: 

https://9t.la9cs.salesforceliveagent.com/content/s/prechatVisitor?endpoint=https%3A%2F%2F9t.la9cs.salesforceliveagent.com%2Fcontent%2Fs%2Fchat%3Flan......................

I already saw there are two similar discussions on the forum without answer.

Any one could give some help? Thanks!

The Sample HTML script are as below:

<html>

<head></head>

<body>

<img id="liveagent_button_online_573O0000000CaUz" style="display: none; border: 0px none; cursor: pointer" onclick="liveagent.startChat('573O0000000CaUz')" src="https://uat-libertyinsurancesg.cs5.force.com/survey/resource/1421128309000/Live_Agent_online_button" /><img id="liveagent_button_offline_573O0000000CaUz" style="display: none; border: 0px none; " src="https://uat-libertyinsurancesg.cs5.force.com/survey/resource/1421129020000/Live_Agent_offline_button" />

<script type="text/javascript">

if (!window._laq) { window._laq = []; }

window._laq.push(function(){liveagent.showWhenOnline('573O0000000CaUz', document.getElementById('liveagent_button_online_573O0000000CaUz'));

liveagent.showWhenOffline('573O0000000CaUz', document.getElementById('liveagent_button_offline_573O0000000CaUz'));

});</script>

<script type='text/javascript' src='https://c.la9cs.salesforceliveagent.com/content/g/js/32.0/deployment.js'></script>

<script type='text/javascript'>

liveagent.addCustomDetail('Company Name', 'Company ABC');

liveagent.setName('John Doe');

liveagent.init('https://d.la9cs.salesforceliveagent.com/chat', '572O0000000CaT3', '00DO00000050jEO');

</script>

</body>

</html>

 
4 answers
  1. Feb 11, 2015, 2:22 AM
    There's a comment from another discussion really help to solve the problem:

    https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AdVQ

    Below 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>

    After added this code, the Live agent client page is working fine for most of browsers.

    For IE9, it requires additional configuration in IE9 broswer:

     1. Turn off the "compatibility mode" for all the sites

    2. Add *.salesforceliveagent.com into Intranet Site

    3. Enable "Running Script"