背景:
我有这个模板,其中包含使用 swfobject 加载的 YouTube 视频。
问题:
有没有办法包含脚本标签...
<script type="text/javascript">
</script>
在 jQuery 模板中??
<script id="filaVideoTemplate" type="text/x-jQuery-tmpl">
<!-- Some HTML here -->
<script type="text/javascript">
<!-- Some javascript here -->
</script>
</script>
显然它不能直接工作,有没有办法在没有其他脚本中的脚本的情况下实现相同的效果?
最佳答案
<script id="filaVideoTemplate" type="text/x-jQuery-tmpl">
<!-- Some HTML here -->
<script type="text/javascript">
<!-- Some javascript here -->
{{html "</sc"+"ript>"}}
</script>
您可以使用 {{html ""}} 替换 </script>
关于javascript - jquery 模板内的 <script> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4788525/