使用方法
1. 下载xhEditor最新版本。
下载地址:http://code.google.com/p/xheditor/downloads/list
2. 解压zip文件,将其中的xheditor.js以及xheditor_emot、xheditor_plugins和xheditor_skin三个文件夹上传到网站相应目录
3. 在相应html文件的</head>之前添加
<script type="text/javascript" src="../../jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../../xheditor.js"></script>
根据需要改变相对路径
4.
方法1:在textarea上添加属性: class="xheditor"
方法2:在您的页面初始JS代码里加上:
$('#elm1').xheditor(true);
例如:
$({
$('#elm1').xheditor(true);
});
相应的隐藏编辑器的代码为
$('#elm1').xheditor(false);
注意:
xheditor.js和xheditor_emot、xheditor_plugins和xheditor_skin必须在同一目录下(一般都在根目录下),否则编辑器的工具条显示不出来
jsp页面:加入
<textarea id="content" name="content" class="xheditor" rows="50" cols="150" style="width:100%">
</textarea>
class还可以取的值