有需求联系

Information

- 信息浏览 -

jquery怎么获取到富文本ueditor编辑器textarea里面的文字和图片内容

2023-12-06 390

在线文档对UEditor说明不够全面,收集了一些常用的方法和基本设置,以供参考。

1、创建编辑器
UE.getEditor('editor',initialFrameWidth:"100%"//初始化选项)
精简版
UE.getEditor('editor')
2、删除编辑器
UE.getEditor('editor').destroy();
3、设置焦点
UE.getEditor('editor').focus();
4、获取编辑器内容
UE.getEditor('editor').getContent()
5、编辑器是否有内容
UE.getEditor('editor').hasContents()
6、获取编辑器内容纯文本格式
UE.getEditor('editor').getContentTxt()
7、获取带格式的纯文本
UE.getEditor('editor').getPlainTxt()
8、启用编辑器
UE.getEditor('editor').setEnabled();
9、禁止编辑
UE.getEditor('editor').setDisabled('fullscreen');
10、获取整个html内容
UE.getEditor('editor').getAllHtml()


UE.getEditor('editor').setContent('xxx'); //赋值

UE.getEditor('editor').getContent(); //取值

UE.getEditor('editor').setContent('', false);//清空内容

image.png

Copyright © 2024 镇江小蚂蚁信息科技有限公司 All Rights Reserved.