使用JQuery我怎样才能CKEditor的内容? [英] How can i get content of CKEditor using JQuery?

查看:190
本文介绍了使用JQuery我怎样才能CKEditor的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的CKEditor。我使用Ajax使用页面方法保存表单值。

I'm using CKEditor. I am saving the form values with ajax using page methods.

但CKEditor的价值的内容不能被保存到表。

But the content of CKEditor value cannot be saving into the table.

我不回发的页面。

我能做些什么是什么?

推荐答案

首先,你应该包括的CKEditor和jQuery连接器脚本在您的网页,

First of all you should include ckeditor and jquery connector script in your page,

然后创建一个文本区域

<textarea name="content" class="editor" id="ms_editor"></textarea>

附加的CKEditor到文本区域,在我的项目我使用这样的:

attach ckeditor to the text area, in my project I use something like this:

$('textarea.editor').ckeditor(function() {
        }, { toolbar : [
            ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
            ['Undo','Redo'],
            ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
            ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
            ['Link','Unlink','Anchor', 'Image', 'Smiley'],
            ['Table','HorizontalRule','SpecialChar'],
            ['Styles','BGColor']
        ], toolbarCanCollapse:false, height: '300px', scayt_sLang: 'pt_PT', uiColor : '#EBEBEB' } );

在提交使用获取内容:

var content = $( 'textarea.editor' ).val();

这就是它! :)

That's it! :)

这篇关于使用JQuery我怎样才能CKEditor的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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