从WYSIWYG CKEditor传递textarea值 [英] Pass textarea value from WYSIWYG CKEditor

查看:65
本文介绍了从WYSIWYG CKEditor传递textarea值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我在WYSIWYG编辑器(CK编辑器)中创建的输入传递给JQuery。目前,无论我输入什么,它都是空白的。

I'm trying to pass the input I made in a WYSIWYG editor (CK Editor) to JQuery. Currently it's blank no matter what I input.

HTML:

<textarea type='text' class="ckeditor reply"  name='reply'></textarea>
<button type="button" STYLE="align: right;" class="btn btn-info reply_button yGreenButton">Submit Reply</button>

JS:

<script>
$(function()
{
    $('.reply_button').click(function(){

        var reply=$(this).siblings('.reply').val();

    });
});
</script>

textarea显示为CKeditor。点击reply_button时提醒的当前值是空白的,无论我放入CKeditor textarea。如何获取我输入的实际内容以提醒?

The textarea shows up as CKeditor. The current value alerted from the clicking the reply_button is blank, no matter what I put in the CKeditor textarea. How to get the actual content I input to be alerted?

非常感谢建议。

最佳,

推荐答案

这是一个CKEditor,你必须使用他们的API:

It's a CKEditor, you have to use their API:

var editor = CKEDITOR.replace( '.ckeditor' );
editor.getData();

可以找到API文档这里

这篇关于从WYSIWYG CKEditor传递textarea值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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