sean1688 Posted February 26, 2015 Share Posted February 26, 2015 purechat is a live chat service, and they provide a very small javascript to install on the website to enable live chat with visitors. their instructions said to: Copy and paste this code just before the closing </body> tag on every page you'd like it to appear. I did a little search on this forum and placed the code in the main.php, but it completely broke the code and the website fail to launch. can someone help? this is the beginning part of the code, I removed part of the code to hide account information. <script type='text/javascript'>(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')) Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted February 26, 2015 Share Posted February 26, 2015 It's because the template engine is trying to parse the JavaScript. It looks for areas in curly brackets... You need to add {literal} tags: http://www.smarty.net/docs/en/language.function.literal.tpl Quote Link to comment Share on other sites More sharing options...
sean1688 Posted February 26, 2015 Author Share Posted February 26, 2015 Thanks! that took care of the problem! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.