Rich-text Reply

Zopim Chat JavaScript in Code Editor Not Validating

stebesplace 08-31-15

Zopim Chat JavaScript in Code Editor Not Validating

[ Edited ]
window.onload = function() { 
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s= 
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set. 
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8'); 
$.src='//v2.zopim.com/?29rI9llgR8QU9yNRMOAAMf1RXfY1QaT6';z.t=+new Date;$. 
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script'); 
} 

The above code block is what Zopim gives me to implement on a web page. When I put that in a script tag, and put it on my page, it works great. But when I load this up into Optimizely, the validator doesn't like it. The code actually works, as I've now tested, but the validation leaves me puzzled. I've even removed spaces, brought things onto a single line, etc. Thoughts?

Re: Zopim Chat JavaScript in Code Editor Not Validating

Hi there,

If the code actually works I wouldn't be too worried here. Sometimes the code validator will throw random errors as it's a bit finicky.

Cool plugin! Haven't heard of it until just now.

Best,
Amy Herbertson
Customer Success