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

用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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题