Ueditor百度编辑器

一 下载ueditor(https://ueditor.baidu.com/website/download.html)
注意:gbk和utf-8
二 将下载好的ueditor整个目录复制到你的jsp项目下
三 导入JS(ueditor.config.js和ueditor.all.js)

<script type="text/javascript"src="ueditor/ueditor.config.js"></script> 
<script type="text/javascript"src="ueditor/ueditor.all.js"></script>

四 创建个块级标签 比如DIV 然后 UE.getEditor(‘Id’);

<div id="editor" name="details" type="text/plain" style="width:900px; height:400px;"></div>
<script type="text/javascript">
    var ue = UE.getEditor('editor');
</script>

五 方法 (上ue对象来调用下面方法)
获得整个html的内容 getAllhtml()
获得内容 getContent()
写入内容 setContent()
追加内容 setContent(true)
获得纯文本 getContentTxt()
获得带格式的纯文本 getPlainTxt()
判断是否有内容 hasContent()
使编辑器获得焦点 setFocus()
编辑器是否获得焦点 isFocus(event)
编辑器失去焦点 setblur(event)
获得当前选中内容 getText()
插入给定的内容 insertHtml()
可以编辑 setEnabled()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值