Php CKeditor内联编辑,获取元素类
因此,我尝试将CKeditor与内联编辑结合使用,并找到了一个插件,该插件将CKeditor元素的当前数据发送到ajax脚本,然后ajax脚本将数据发送到php脚本以进行保存。但是,由于每个页面上都需要多个编辑器实例,因此我需要将编辑器实例的id与数据一起发送。这些是我的文件: index.phpPhp CKeditor内联编辑,获取元素类,php,jquery,html,ajax,ckeditor,Php,Jquery,Html,Ajax,Ckeditor,因此,我尝试将CKeditor与内联编辑结合使用,并找到了一个插件,该插件将CKeditor元素的当前数据发送到ajax脚本,然后ajax脚本将数据发送到php脚本以进行保存。但是,由于每个页面上都需要多个编辑器实例,因此我需要将编辑器实例的id与数据一起发送。这些是我的文件: index.php <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <t
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CKeditor test</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
</head>
<body>
<div class="content">
<div class="editable" contenteditable="true">
Hello there my friend.
</div>
</div>
<script type="text/javascript">
window.onload = function()
{
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline( '.editable' )
}
</script>
</body>
</html>
如何才能做到这一点?我也有同样的问题 您可以这样做,因为您已经拥有内联编辑器正在处理的元素:
data: {
editabledata: data,
id: element.attr('id')
}
然后在dump.php的传入请求中有2个POST值,您可以通过以下方式获得元素的Id:
editor.container.getId()
editor.container.getId()