在CKEditor插件中使用jquery [英] Use jquery inside CKEditor plugin

查看:106
本文介绍了在CKEditor插件中使用jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一些ckeditor插件来操纵一个完整的html文档的格式(例如,你按下一个编辑器的按钮,选择成为一个标注,或移动到一个新的列)。 CKEditor API不是为我剪切,所以我想在插件中使用jquery编辑器的内容。任何建议?

I'm trying to create a few ckeditor plugins that manipulate the a full html document's formatting (e.g. you push one of the editor's buttons and the selection becomes a callout, or moves to a new column). The CKEditor API isn't cutting it for me, so I'd like to use jquery on the editor's contents within the plugins. Any suggestions?

这是在Drupal使用wysiwyg插件。

This is within Drupal using the wysiwyg plugin.

推荐答案

p>我使用JQuery插件在所有的时间,它的工作原理就像一个普通的javascript文件。我建议你加载你的编辑器在jquery的ready事件,至少确保jquery加载。

I use JQuery in my plugins all the time and it works just like within a normal javascript file. I suggest that you load your editor in jquery's ready event, that at least makes sure that jquery is loaded.

这样应该确保你的插件可以使用jquery,因为

Something like this should make sure that your plugins can use jquery because it's loaded beforehand.

<script type="text/javascript">
    $(document).ready(function () {
        CKEDITOR.replace( 'MyLittlePonyFanficEditorTextarea' );
    });
</script>

这篇关于在CKEditor插件中使用jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆