0

私は MVC3 CKeditor に取り組んでおり、送信ボタンをクリックしたときに CKeditor に追加のデータを挿入する必要があります。これどうやってするの?これまでのコードは次のとおりです。これは私のhtmlページです

        <div id="div-child-Cat-Desc-Long" class="CKEditor-child-DIV">
                    @Html.TextAreaFor(m => m.Message, new { Class = "input-xlarge", @id = "txtAreasocial",@rows="3" })
                </div>

$(document).ready(function () {
    //Passing the Text Area reference to get the CK Editor
    var editor = CKEDITOR.editor.replace('txtAreasocial');
});

 $('#btnadd').click(function () {
    alert('hi');

    var data = "Hello. This is a new node.";
    alert(data);
    CKEDITOR.editor.setData(data);

    editor.setData(data)
});
4

3 に答える 3