Jquery:;CKEDITOR无法读取属性';GetData';未定义的

Jquery:;CKEDITOR无法读取属性';GetData';未定义的,jquery,ckeditor,Jquery,Ckeditor,我使用ckeditor.js做文本区域编辑器 为了得到值,我使用 CKEDITOR.instances.content.GetData(); 我犯了这个错误 Cannot read property 'GetData' of undefined 那我该怎么修呢 这是我的密码 <script src="js/Lib/CKEdit/ckeditor.js"></script> <button type="button" onclick="test()">te

我使用
ckeditor.js
做文本区域编辑器

为了得到值,我使用

 CKEDITOR.instances.content.GetData();
我犯了这个错误

Cannot read property 'GetData' of undefined
那我该怎么修呢

这是我的密码

<script src="js/Lib/CKEdit/ckeditor.js"></script>
<button type="button" onclick="test()">test</button>
<div class="col-lg-10">
    <textarea class="form-control" id="txtFT_Content" name ="txtFT_Content"></textarea>
    <script>
        CKEDITOR.replace( 'txtFT_Content', { } );
        function test()
        {
            var x = CKEDITOR.instances.content.GetData();
            alert( x );
        }
    </script>
</div>

测试
CKEDITOR.replace('txtFT_Content',{});
功能测试()
{
var x=CKEDITOR.instances.content.GetData();
警报(x);
}

您使用了错误的实例id和错误的方法名称。试一下

CKEDITOR.instances["txtFT_Content"].getData();

这将返回该CKEditor实例的HTML内容。

您使用了错误的实例id和方法名称。试一下

CKEDITOR.instances["txtFT_Content"].getData();
这将返回该CKEditor实例的HTML内容