如何修复LiveChatInc语法错误?

时间:2015-06-16 14:32:02

标签: javascript

在Chrome中,我收到此错误:  SyntaxError: Unexpected identifier on line 1 _https://secure.livechatinc.com/licence/ (mylicense) /script.cgi?lang=en&groups=0

error

该脚本的响应是:

LIVECHAT Control Server xxxxxx (May 26 2015)

以下是添加script.cgi文件的脚本

<script type="text/javascript">
  //<![CDATA[
    (function() {
      var license = 'mylicense',
          params = '',
          lang = 'en',
          skill = '0';

      __lc_load = function (p) { if (typeof __lc_loaded != 'function')
        if (p) { var d = document, l = d.createElement('script'), s = d.getElementsByTagName('script')[0], a = unescape('%26'),
          h = ('https:' == d.location.protocol ? 'https://' : 'http://'); l.type = 'text/javascript'; l.async = true;
          l.src = h + 'gis' + p +'.livechatinc.com/gis.cgi?serverType=control'+a+'licenseID='+license+a+'jsonp=__lc_load';
          if (typeof p['server'] == 'string' && typeof __lc_serv != 'string') {
            l.src = h + (__lc_serv = p['server']) + '/licence/'+license+'/script.cgi?lang='+lang+a+'groups='+skill;
            l.src += (params == '') ? '' : a+'params='+encodeURIComponent(encodeURIComponent(params)); s.parentNode.insertBefore(l, s);
          } else setTimeout(__lc_load, 1000); typeof __lc_serv != 'string' && s.parentNode.insertBefore(l, s);
        } else __lc_load(Math.ceil(Math.random()*5)); }
      __lc_load();
    })();
  //]]>
  </script>

插入的代码是:

<script type="text/javascript" async="" src="https://secure.livechatinc.com/licence/mylicense/script.cgi?lang=en&amp;groups=0"></script>

1 个答案:

答案 0 :(得分:0)

我在LiveChat工作,我检查了这个问题。我注意到你使用旧代码,这可能是问题的原因。请尝试从此处获取新内容:https://my.livechatinc.com/settings/code

这应该会有所帮助,但如果您有任何问题,可以访问我们的网站并与我们聊聊:)

问候!

Agnieszka / LiveChat