我正在研究 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)
});