日期:2014-05-17  浏览次数:20546 次

关于KindEditor上传图片,用过KindEditor的来,求指点
  到网上找了很多例子,都实现不了,我这里实现KindEditor的代码:
<script type="text/javascript">
     var editor;
     KindEditor.ready(function (K) {
         editor = K.create('textarea', {
             resizeType: 0,
             allowImageUpload: true,
             imageUploadJson: '../../asp.net/upload_json.ashx',
             fileManagerJson: '../../asp.net/file_manager_json.ashx',

             items: ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', '|', 'selectall', '-',
'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
'flash', 'media', 'advtable', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']
         });
     });

     function getValues() {

         var html = editor.html();

         editor.sync();
         html = document.getElementById('textarea').value;
         alert(html);
     }

  </script>
这样子已经能用了,功能也有了,但上传图片和视频都是报js错误,没有权限,我要怎样指定上传的地址?麻烦用过的人详细解说下,谢谢,我用的是asp.net

------解决方案--------------------
我的都没问题,还有KindEditor文件夹里面的upload_json.ashx和file_manager_json.ashx你自己要适当的修改。如果你网站发布到了服务器,要给kindeditor上传的文件夹添加everyone的用户权限。
 var editor1;
KindEditor.ready(function(K) {
    editor1 = K.create('#txtContent', {
cssPath : '../KindEditor/plugins/code/prettify.css',
uploadJson : '../KindEditor/upload_json.ashx',
fileManagerJson : '../KindEditor/file_manager_json.ashx',
allowFileManager : true,
afterCreate : function() {
var self = this