程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> javascript-用kindeditor上傳圖片出錯

javascript-用kindeditor上傳圖片出錯

編輯:編程解疑
用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);
})

最佳回答:


找到錯誤了是這個zh-CN.js名字的問題:
官方給的是demo裡面寫的是:'zh_CN.js'
實際js的名字叫zh-CN.js
都怪自己懶直接復制

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved