当前版本 4.1.11
下载地址:http://download.csdn.net/download/yingmengxuepingbao/9482888
将整个文件夹放置到 www/public/js中
设置上传路径及url
kindeditor/upload_json.php
//文件保存目录路径
$save_path = $php_path . '../../../../../www/Public/Uploads/News/';
//文件保存目录URL
$the_domain='http://www.xxoo.local';
$save_url = $the_domain.'/Public/Uploads/News/';
开启图片空间
在kindeditor-all.js中
KindEditor.plugin('image', function(K) {
allowFileManager = K.undef(self.allowFileManager, true),
默认false改成true
在file_manager_json.php中,修改路径
$root_path = $php_path . '../../../../../www/Public/Uploads/News/';
$the_domain='http://www.xxoo.local';
$root_url = $the_domain.'/Public/Uploads/News/';
在网页中调用
<textarea name="content" id="content" style="width: 800px; height: 350px;">内容</textarea>
<!--Kindeditor-->
<script charset="utf-8" src="__PUBLIC__/js/kindeditor/kindeditor-all.js"></script>
<script charset="utf-8" src="__PUBLIC__/js/kindeditor/lang/zh-CN.js"></script>
<script>
KindEditor.ready(function(K) {
window.editor = K.create('#content');
});
</script>
在提交时,要做这一步
$("input[name='submit']").click(function(){
//将编辑器ifreme的值传到textarea
$("#content").html(window.editor.html());
var content=$("#content").val();
//alert(content);return false;
if(content == null || content == ""){
alert('详情不能为空');
return false;
}
有图有真相