Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道是否有任何方法可以在 Genshi 中创建 javascrit 模板?我的意思是,我需要一个 .js 文件,我可以在其中使用诸如此类的指令<py:for>。
<py:for>
任何想法?谢谢!
您可以像这样直接在html中编写它:
<script type="text/javascript"> <py:if test="func1"> /*<![CDATA[*/ function func1() { } /*]]>*/ </py:if> </script>
注意:CDATA 中的代码将被正确转义,因此您可以像往常一样使用“>”、“<”。