&LT;脚本&GT; jQuery的模板内标签 [英] <script> tag inside jquery template
本文介绍了&LT;脚本&GT; jQuery的模板内标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
研究背景:
我有这个模板,其中包括来自YouTube视频加载与SWFObject的。
问:
有没有一种办法,包括脚本标记...
&LT;脚本类型=文/ JavaScript的&GT;
&LT; / SCRIPT&GT;
里面一个jQuery模板??
&LT;脚本ID =filaVideoTemplate类型=文/ X-的jQuery TMPL&GT;
&LT;! - 一些HTML这里 - &GT;
&LT;脚本类型=文/ JavaScript的&GT;
&LT;! - 一些JavaScript在这里 - &GT;
&LT; / SCRIPT&GT;
&LT; / SCRIPT&GT;
显然,它并不直接工作,有什么办法才达到同样的事情,里面没有其他脚本,该脚本?
解决方案
&LT;脚本ID =filaVideoTemplate类型=文/ X-的jQuery TMPL&GT;
&LT;! - 一些HTML这里 - &GT;
&LT;脚本类型=文/ JavaScript的&GT;
&LT;! - 一些JavaScript在这里 - &GT;
{{的html&所述; / SC+RIPT&gt;中}}
&LT; / SCRIPT&GT;
您可以使用{{HTML&LT; / SC+RIPT>}}代替&LT; / SCRIPT>
Backgroud:
I have this template that includes videos from youtube being loaded with swfobject.
Question:
Is there a way to include a script tag...
<script type="text/javascript">
</script>
inside a jQuery Template??
<script id="filaVideoTemplate" type="text/x-jQuery-tmpl">
<!-- Some HTML here -->
<script type="text/javascript">
<!-- Some javascript here -->
</script>
</script>
Obviously it doesn't work directly, is there any way to achive the same thing without the script inside other script?
解决方案
<script id="filaVideoTemplate" type="text/x-jQuery-tmpl">
<!-- Some HTML here -->
<script type="text/javascript">
<!-- Some javascript here -->
{{html "</sc"+"ript>"}}
</script>
You can use {{html "</sc"+"ript>"}} replace </script>
这篇关于&LT;脚本&GT; jQuery的模板内标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文