CKeditor 上的 Jquery 事件
你好 在一个带有 ID 为“ckeditor_input”的文本区域的表单中,
$("#ckeditor_input").ckeditor();
$("#ckeditor_input").html(); // can get the value
("#ckeditor_input").click/blur/keydown/keypressed(
function(){
alert("OK");
}
); //doesn't work!
问题是 ckeditor!如果我不在文本区域上启动 ckeditor 实例,所有事件都会正常工作!在 ckeditor 实例上获取事件的正确方法是什么?
谢谢
Hello
in a form with a textarea with id "ckeditor_input"
$("#ckeditor_input").ckeditor();
$("#ckeditor_input").html(); // can get the value
("#ckeditor_input").click/blur/keydown/keypressed(
function(){
alert("OK");
}
); //doesn't work!
the problem is ckeditor! If I don't start an instance of ckeditor on the textarea all events work fine! What is the right way to get events on a ckeditor instance?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CKEditor 使用 iframe...对于 jQuery 事件来说非常烦人。你可以尝试:
我还没有测试过,所以不完全确定它是否有效。但我确信这是解决方案的起点。让我知道进展如何,如果不起作用,我会尝试找出问题所在。
编辑::(基于评论)
我认为应该这样做。但只有在 CKEditor 正确加载后才能运行它。
CKEditor uses an iframe... very annoying for jQuery events. You could try:
I haven't tested it so not entirely sure whether it'll work. But I'm sure that's the starting point for the solution. Let me know how it goes, and if it doesn't work I'll try and work out what the problem is.
Edit:: (based on the comment)
I think that should do it. But only run it after CKEditor has loaded properly.