[英]How to get the save Event in ckeditor editor?
我有解決方案,請使用此
CKEDITOR.plugins.registered['save'] = {
init: function (editor) {
var command = editor.addCommand('save',
{
modes: { wysiwyg: 1, source: 1 },
exec: function (editor) { // Add here custom function for the save button
alert('You clicked the save button in CKEditor toolbar!');
}
});
editor.ui.addButton('Save', { label: 'Save', command: 'save' });
}
}
.formSubmit是表單的類名,
var data = CKEDITOR.instances.editor1.getData(); 這是textarea的數據
$('.formSubmit').submit( function(){
var data = CKEDITOR.instances.editor1.getData();
$.ajax({
type: 'POST',
url: 'ck_bienban_1_luu.php',// url of phpcode save
data: {
data: data,
},
success: function() {
},
});
return(false);
}
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.