版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xubuhang/article/details/78608604
https://ckeditor.com/
当前最新版本
http://download.cksource.com/CKEditor/CKEditor/CKEditor%204.7.3/ckeditor_4.7.3_full.zip
<!DOCTYPE html>
<!--
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body id="main">
<textarea cols="80" id="Text" name="Text" rows="20">这里是默认值,修改文本的内容是放在这里。html需要进行HTMLEncode编码</textarea>
<button onclick="OnSave()"> 保存 </button>
<script type="text/javascript">
var editor = CKEDITOR.replace('Text');
function OnSave(){
if(CKEDITOR.instances.Text.getData()==""){
alert("内容不能为空!");
return false;
}else {
alert (CKEDITOR.instances.Text.getData());
}
}
</script>
</body>
</html>