我该如何使用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);
你可能希望把它放在模糊事件或其他什么事件中。