首页 > 后端开发 > php教程 > Fatal error: Smarty error:syntax error: unrecognized tag,该怎么解决

Fatal error: Smarty error:syntax error: unrecognized tag,该怎么解决

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
发布: 2016-06-13 13:13:29
原创
1098 人浏览过

Fatal error: Smarty error:syntax error: unrecognized tag
求助,代码如下,模板文件Login.tpl中,
<script><br />function create_code(){<br /> document.getElementByIdx_x("code").src = 'create_code.php?'+Math.random()*10000;<br />}<br /></script>

一直报错:“Fatal error: Smarty error: [in Login.tpl line 93]: syntax error: unrecognized tag: document.getElementByIdx_x("code").src = 'create_code.php?'+Math.random()*10000; (Smarty_Compiler.class.php, line 446) in I:\masterPHP\vtigercrm\Smarty\libs\Smarty.class.php on line 1095

求各位大神指导!!!

------解决方案--------------------
smarty 的 tpl 里面 要直接写 javascript 或 style 要用 literal 标签 包起来
例:

HTML code

1

2

3

4

5

6

7

8

9

10

11

12

{literal}

<script>

function create_code(){

    document.getElementByIdx_x("code").src = 'create_code.php?'+Math.random()*10000;

}

</script>

{/literal} <div class="clear">

                  

               

               

         

            </div>

登录后复制
相关标签:
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
git - code review是什么?
来自于 1970-01-01 08:00:00
0
0
0
javascript - vscode的code runner插件
来自于 1970-01-01 08:00:00
0
0
0
javascript - vs code 怎么离线安装插件
来自于 1970-01-01 08:00:00
0
0
0
安装code runner后不能运行php文件
来自于 1970-01-01 08:00:00
0
0
0
javascript - 微信授权登录code 40163
来自于 1970-01-01 08:00:00
0
0
0
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板