ueditor富文本编辑器嵌入jsp页面

第一步:
将ueditor1_4_3_3-utf8-jsp.zip压缩包解压全部文件放到ueditor2文件夹下

 

这里写图片描述

这里写图片描述


第二步:
在需要嵌入富文本编辑器的页面,导入对应的js.

<meta http-equiv="CONTENT-TYPE" content="text/html;charest=utf-8">
<script type="text/javascript" charset="utf-8" src="../../ueditor2/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../../ueditor2/ueditor.all.js"></script>
<link href="../../ueditor2/themes/default/css/ueditor.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8" src="../../ueditor2/lang/zh-cn/zh-cn.js"></script>

注意注意注意!!!
这个导入js或者css的顺序一定不要互换,顺序不一致的话结果就会出不来。

第三步:
在jsp页面,需要加入富文本编辑器的部分,加入一个字段 id="editor"

<textarea id="editor" name="content" type="text/plain" style="width: 1000px ; height: 500px">
这里可以书写
</textarea>

<script type="text/javascript">
UE.getEditor('editor');
</script>

括号内‘ ‘ 的单词应该与id保持一致。

ok啦,功能实现!!!

posted @ 2019-05-28 22:44  跶哒达  阅读(848)  评论(0编辑  收藏  举报