4
我如何在使用Javascript的CKEditor中查找和替換文本? 感謝您的建議!如何使用Javascript在CKEditor中查找和替換文本?
我如何在使用Javascript的CKEditor中查找和替換文本? 感謝您的建議!如何使用Javascript在CKEditor中查找和替換文本?
試試這個
editor = CKEDITOR.instances.fck; //fck is just my instance name you will need to replace that with yours
var edata = editor.getData();
var replaced_text = edata.replace("idontwant", "iwant this instead"); // you could also use a regex in the replace
editor.setData(replaced_text);
您可能希望把在模糊事件或soemthing
@Kyaw Thurein你的歡迎! – mcgrailm 2011-04-12 12:56:44
有沒有辦法讓這段代碼工作onkeyup? – 2012-10-31 14:42:55
@StanislasPiotrowski看看這個鏈接http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-change – Andrey 2013-11-23 21:41:15