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啦,功能实现!!!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM