• Closed by: Marek
  • Closed on: 13.07.18, 14:44
  • Reason: Closed
  • Comment: Glad to help!

Ticket #12529 - Javascript custom code only in Admin

Hello,

I have this two javascripts code and I want to appear on my site, it only appears on the administration page.
I added the theme settings, personalized JS.

I’m waiting for help.

<!–Start of Zendesk Chat Script–>
<script type=”text/javascript”>
window.$zopim||(function(d,s){var z=$zopim=function©{z._.push©},$=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/?5qYOyBu1cm15DCebyzawy2d7aU77cwDH“;z.t=+new Date;$.
type=”text/javascript”;e.parentNode.insertBefore($,e)})(document,”script”);
</script>
<!–End of Zendesk Chat Script–>

<script type=’text/javascript’ data-cfasync=’false’>window.purechatApi = { l: [], t: [], on: function () { this.l.push(arguments); } }; (function () { var done = false; var script = document.createElement(’script’); script.async = true; script.type = ‘text/javascript’; script.src = ‘https://app.purechat.com/VisitorWidget/WidgetScript‘; document.getElementsByTagName(’HEAD’).item(0).appendChild(script); script.onreadystatechange = script.onload = function (e) { if (!done && (!this.readyState || this.readyState == ‘loaded’ || this.readyState == ‘complete’)) { var w = new PCWidget({c: ‘da963f27-3a18-4360-99e1-fea764be48e9’, f: true }); done = true; } }; })();</script>

Comments

Pascovski Victor 12 Jul 2018, 21:54

I resolve this problem.

It did not work with custom JS, I put the code in a JS file of the theme.

Marek 13 Jul 2018, 14:44

Ok, great!