主頁 > 論壇 > 设计与开发 >

如何在xml块中插入javascript

« 
前一個主題
|
|

You need to be logged in to get access to the forums. You can do so here

作者 訊息

陈 明星

2007年 六月 28日(星期四) 5:10:31 am

所谓的xml块主要是指内容 javascript可以通过{literal}{/literal}加到template里面,但很多时候我们希望能自由控制js的内容,比如它是用来显示广告的,那么我们需要把他插入到content里面。 方法一:可以用<literal class="html"></literal> 在content.ini里面,有 <code>[literal] AvailableClasses[] # The class 'html' is disabled by default because it gives editors the # possibility to insert html and javascript code in XML blocks. # Don't enable the 'html' class unless you really trust all users who has # privileges to edit objects containing XML blocks. #AvailableClasses[]=html CustomAttributes[]</code> 我们开启AvailableClasses[]=html,然后在编辑content的时候加入 <code> <literal class="html"> Your code </literal> </code> 方法二:也可以定制自己的标签customer tags