1. 程式人生 > >jQuery怎麼獲取到富文字ueditor編輯器裡面的文字和圖片內容

jQuery怎麼獲取到富文字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()

11、常用設定

imageUrl:UEDITOR_HOME_URL + "../yunserver/yunImageUp.php", //圖片上傳介面

imagePath:"http://",

scrawlUrl:UEDITOR_HOME_URL + "../yunserver/yunScrawlUp.php",//塗鴉介面

scrawlPath:"http://",

fileUrl:UEDITOR_HOME_URL + "../yunserver/yunFileUp.php",//檔案上傳介面

filePath:"http://",

catcherUrl:UEDITOR_HOME_URL + "php/getRemoteImage.php",//獲取遠端圖片介面

catcherPath:UEDITOR_HOME_URL + "php/",

imageManagerUrl:UEDITOR_HOME_URL + "../yunserver/yunImgManage.php",//圖片管理介面

imageManagerPath:"http://",

snapscreenHost:'ueditor.baidu.com',

snapscreenServerUrl:UEDITOR_HOME_URL + "../yunserver/yunSnapImgUp.php",//截圖介面

snapscreenPath:"http://",

wordImageUrl:UEDITOR_HOME_URL + "../yunserver/yunImageUp.php",//word圖片轉存介面

wordImagePath:"http://", //

getMovieUrl:UEDITOR_HOME_URL + "../yunserver/getMovie.php",//獲取視訊介面

lang:/^zh/.test(navigator.language || navigator.browserLanguage || navigator.userLanguage) ? 'zh-cn' : 'en',

langPath:UEDITOR_HOME_URL + "lang/",

webAppKey:"9HrmGf2ul4mlyK8ktO2Ziayd",

initialFrameWidth:860, //初始化寬度

initialFrameHeight:420, //初始化高度

focus:true //是否焦點

更多的功能和外掛:地址:https://www.kancloud.cn/he_he/thinkphp5