Adding javascript code

Posted in: Newspaper
Post count: 114

Hi
I need to install a chat demo in the site, but when I try to insert the javascript code in “Custom Javascript”, the system show me alerts. The code was given to me by the company (zopim). The newspaper theme panel say “Please do not include the <script> </ script>”, and if I delete this, the system shows me alert messages. I do not know how to enter it. the code is

<!–Start of Zendesk Chat Script–>
<script type=”text/javascript”>
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=’https://v2.zopim.com/?5UGUoBISPPvytCAgmH44AniqGGti4trK&#8217;;z.t=+new Date;$.
type=’text/javascript’;e.parentNode.insertBefore($,e)})(document,’script’);
</script>
<!–End of Zendesk Chat Script–>

Thank!

Post count: 20688

Hi,

If the provided code is valid then there should be no problem. You could test the code in a different environment and it see if it works. Maybe there is something wrong with it. I get a few warnings when entering the code you mention
https://www.screencast.com/t/xKPPt8aVm94B

Thanks

Post count: 114

Thanks. Finally the script could be inserted in footer and no in head. I don’t know why, but now works.
Thanks again.

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.