我想使用新CKEditor 4的"内联编辑"(http://docs.ckeditor.com/#/guide/dev_inline-section-2),但找不到任何关于如何使用PHP/MMySQL保存数据的示例。你能帮我吗?
下面是一个关于如何从Ckeditor传递数据的示例。通过按下按钮,您可以通过ajax保存内容。
<div id="editable" contenteditable="true">
<h1>Inline Editing in Action!</h1>
<p>The div element that contains this text is now editable.
</div>
<button type='button' id='save'><span>Save</span></button>
<script>
$(document).ready(function (e) {
$("#save").click(function (e) {
var data = CKEDITOR.instances.editable.getData();
var options = {
url: "/path/to/php",
type: "post",
data: { "editor" : encodeUriComponent(data) },
success: function (e) {
//code to do when success
}
};
}
});
</script>