下雨天没带雨伞 2016-11-09 08:18 采纳率: 75%
浏览 1212
已采纳

用kindeditor上传图片出错

控制台大给出的错误信息是:
zh-CN.js:1Uncaught SyntaxError: Unexpected token <
是js的问题吗?求大虾帮忙
创建的代码如下:
KindEditor.ready(function (K) {
var options = {
width:'100%',
height:'500px',
cssPath :'__ROOT__/js/kindeditor/plugins/code/prettify.css',
uploadJson : '__ROOT__/js/kindeditor/upload_json.php',
fileManagerJson : '__ROOT__/js/kindeditor/file_manager_json.php',
allowImageUpload:true,//允许上传图片
allowFileManager:true, //允许对上传图片进行管理
items: [
'source', '|', 'undo', 'redo', '|', 'preview', 'template', 'code', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'quickformat', 'selectall', '|',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
'insertfile', 'table', 'hr', 'emoticons', 'pagebreak', 'link', 'unlink'
],
autoHeightMode : true, //启用编辑区自动高度
afterChange : function () { //输入文字事件
var autoheight = K.IE ? this.edit.doc.body.scrollHeight : this.edit.doc.body.offsetHeight; //判断是否是IE,并获取内容高度。
this.edit.setHeight(autoheight); //设置高度
},
afterCreate : function() {
this.sync();
},
afterBlur:function(){
this.sync();
}
};
var zh_edit = K.create('#content', options);
})

  • 写回答

3条回答 默认 最新

  • 下雨天没带雨伞 2016-11-10 01:47
    关注

    找到错误了是这个zh-CN.js名字的问题:
    官方给的是demo里面写的是:'zh_CN.js'
    实际js的名字叫zh-CN.js
    都怪自己懒直接复制

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试