資料載入中

胡言亂語

Ckeditor使用onkeyup事件綁定卻無動作解決方式

其實這個問題我已經想解決很久了~

之前就是懶得動....

總之~

首先,假設編輯器為 Content

實現事件綁定方式為:
CKEDITOR.instances["Content"].on("instanceReady", function () {
//set keyup event
this.document.on("keyup", AutoRun);
//set keydown event
//this.document.on("keydown", AutoStop);
//and click event
this.document.on("click", AutoRun);
//and select event
this.document.on("select", AutoRun);
});

接著綁定事件所執行的function如下:
function AutoRun() {
CKEDITOR.tools.setTimeout(function () {
var editorText = CKEDITOR.instances.Content.getData();
alert(editorText);//當沒動作3秒後執行
}, 3000);
}


以上紀錄~

  • 解決編輯器事件綁定問題
  • 懶得動的解決方法
  • 事件綁定的實現方式
  • 編輯器功能的實作過程
  • 綁定事件的執行函數
https://innstory.com/story-Ckeditor使用onkeyup事件綁定卻無動作解決方式-1824

上一篇
 使用javascript獲取ckeditortextarea的textarea值

下一篇
fancyboxclose的方式 

發表留言

作者簡介

離不開電腦的宅男


推薦閱讀

作者其他相關類別故事

分享 颱風放假一天,但你知道日韓沒颱風假嗎?-風傳媒

分享 颱風放假一天,但你知道…

Mark Chang 7 年又 190 天 2.2K

這倒是讓我記起2017日本電影「 生存家族」裡的劇情~ 故事是設置在沒有電的環境作為舞台開始~ 劇中...

Weak SSL Cipher在Apache中禁用過時的SSL / TLS版本

Weak SSL Ciphe…

Mark Chang 6 年又 54 天 1.9K

使用vi(或vim)編輯ssl.conf (通常位於/etc/httpd/conf.d/底下) 查詢...

分享 吃蝗蟲治武漢肺炎中國網民樂翻:天賜良藥!

分享 吃蝗蟲治武漢肺炎中國網…

Mark Chang 5 年又 331 天 1.6K

蝗蟲 VS 中國 雖然這不是開玩笑的時候。 所以我該替蝗蟲擔心嗎?