Loading...

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

Temperature: 0 °C

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

之前就是懶得動....

總之~

首先,假設編輯器為 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

Prev
 使用javascript獲取ckeditor_textarea的textarea值

Next
fancybox_close的方式 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

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

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

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

嘰嘰喳喳

嘰嘰喳喳

我們總是在世人面前假裝自己以為的瀟灑。 卻過不了自己在心裏築起的高牆。...

分享 人事動盪!近400天GoogleCloud旅程告終台灣區總經理邵光華低調卸任|數位時代

分享 人事動盪!近400天GoogleCloud旅程告終台灣區總經理邵光華低調卸任|數位時代

其實新聞裡沒有提動任何關於hp的關鍵字,但我在畫面中卻只看到hp。 #hp螢幕...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format