我正在使用MVC3 CKeditor,我需要在CKeditor中插入一些額外的數據,當我點擊提交按鈕時。我怎樣才能做到這一點?我的代碼到目前爲止如下:這是我的HTML頁面如何使用jquery向ckeditor添加額外的數據?
<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)
});
額外的數據意味着..什麼?你到底想要什麼? – rash111
extradata意味着我會得到選定的複選框的價值像產品 和類似的類型我需要將它添加到ckeditor –