-4
我想創建一個包含CKEDITOR的html文件,當編輯完成後,html文件會被正確修改。頁面自我編輯
<html>
<head>
<title>Editable</title>
// Adds CKEDITOR
<script src="//cdn.ckeditor.com/4.4.6/standard/ckeditor.js"></script>
</head>
<body>
// Simple DIV with in-line CKEDITOR
<div id="editable1" contenteditable="true">
<h1>Inline Editing in Action!</h1>
<p>The "div" element that contains this text is now editable.
</div>
<script>
//Adds the editor
CKEDITOR.disableAutoInline = true;
CKEDITOR.inline('editable');
//When focus is lost, it will perfom the action
CKEDITOR.instances.editable.on('blur', function(e)
{
//Right now this change is only client side, i would like to make it serverside
$data = CKEDITOR.instances.editable.getData()
$id = this.element.$.id
document.getElementById('editable').innerHTML = $data
});
</script>
</body>
</html>
如果你看到了,我評論了代碼,所以很好解釋。 我有一個ID,我有一個新的數據,我想修改原來的HTML文件。 我應該使用女巫語言嗎?任何特定的庫?
我想我需要使用PHP
感謝,
謝謝!我會努力學習更多! <3 –