无法分析django中的提醒
我想在jquery模板中添加一个脚本标记。所以我指的是这个。 它指示按以下方式关闭内部脚本标记:无法分析django中的提醒,django,django-templates,jquery-templates,Django,Django Templates,Jquery Templates,我想在jquery模板中添加一个脚本标记。所以我指的是这个。 它指示按以下方式关闭内部脚本标记: <script id="filaVideoTemplate" type="text/x-jQuery-tmpl"> <!-- Some HTML here --> <script type="text/javascript"> <!-- Some javascript here --> {{html "</sc"+
<script id="filaVideoTemplate" type="text/x-jQuery-tmpl">
<!-- Some HTML here -->
<script type="text/javascript">
<!-- Some javascript here -->
{{html "</sc"+"ript>"}}
</script>
{{html”“}}
我试过了,但django显示了这个错误:
无法分析“html”“中的其余部分:“”
1.我怎么能这样做。django中是否有任何特定的解决方案?
{
和}
是django模板中的保留字符,因此需要使用
替换:
{{html "</sc"+"ript>"}}
{{html”“}
与:
{%templatetag openbrace%}{%templatetag openbrace%}html”“{%templatetag closebrace%}{%templatetag closebrace%}
Hi Dominic,在“”后面有一个不必要的右括号。请把它拿走。
{% templatetag openbrace %}{% templatetag openbrace %}html "</sc"+"ript>"{% templatetag closebrace %}{% templatetag closebrace %}