2013-08-01 79 views
-4

您好所有試圖通過使用下面的代碼安裝siteheart實時聊天:網站心臟未捕獲的異常

<script type="text/javascript"> 
    _shcp = []; 
    _shcp.push({widget_id : 613530, widget : "Chat", side : "top", position : "left" }); 

    (function(){ 
     var hcc = document.createElement("script"); 
     hcc.type = "text/javascript"; 
     hcc.async = true; 
     hcc.src = ("https:" == document.location.protocol ? "https" : "http") + "://widget.siteheart.com/apps/js/sh.js"; 
     var s = document.getElementsByTagName("script")[0]; 
     s.parentNode.insertBefore(hcc, s.nextSibling); 
    })(); 
</script> 

但是,讓下一個錯誤:

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "

這是什麼,爲什麼會出現這個?

+0

裏面是不是因爲我使用本地機器? –

+0

錯誤是語法錯誤。 –

回答

1

看起來像你在你的頁面上使用smarty。我認爲這個錯誤與JavaScript上的大括號有關,它干擾了smarty語法。

嘗試把你的腳本文字智者塊

{literal} 
    <script type="text/javascript"> _shcp = []; _shcp.push({widget_id : 613530, widget : "Chat", side : "top", position : "left" }); (function() { var hcc = document.createElement("script"); hcc.type = "text/javascript"; hcc.async = true; hcc.src = ("https:" == document.location.protocol ? "https" : "http")+"://widget.siteheart.com/apps/js/sh.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hcc, s.nextSibling); })(); </script> 
{/literal} 
+0

謝謝幫助! –

+0

如果我的答案幫助你,請將其標記爲正確答案 – Sutulustus