使用集成的php输出kindeditor无法初始化
function showEditor($id, $value='', $width='700px', $height='300px', $style='visibility:hidden;',$upload_state="true", $media_open=false, $type='all'){ //是否开启多媒体 $media = ''; if ($media_open){ $media = ", 'flash', 'media'"; } switch($type) { case 'basic': $items = "['source', '|', 'fullscreen', 'undo', 'redo', 'cut', 'copy', 'paste', '|', 'about']"; break; case 'simple': $items = "['source', '|', 'fullscreen', 'undo', 'redo', 'cut', 'copy', 'paste', '|', 'fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link', '|', 'about']"; break; default: $items = "['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', '|', 'selectall', 'clearhtml','quickformat','|', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image'".$media.", 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']"; break; } //图片、Flash、视频、文件的本地上传都可开启。默认只有图片,要启用其它的需要修改resource\kindeditor\php下的upload_json.php的相关参数 echo ''; echo ''; echo ' '; return true;}
页面直接引用php <?php showEditor('content');?>发现无法初始化
后来发现 异步加载主要的问题是KindEditor.ready无法执行,修改在页面上引用即可
参考:http://www.cnblogs.com/zuri/p/6846866.html
http://kindeditor.net/view.php?bbsid=4&postid=6206