KindEditor调用出错,异常信息如下图

yghuaa 2015-03-17 10:33:37

这个是写的代码,和官网是一样的,怎么会有 Uncaught TypeError: undefined is not a function 这个异常信息呢???
<link rel="stylesheet" href="Kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="Kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="Kindeditor/JS/kindeditor.js"></script>
<script charset="utf-8" src="Kindeditor/JS/zh_CN.js"></script>
<script charset="utf-8" src="Kindeditor/plugins/code/prettify.js"></script>
<script>
var editor1, editor2;
KindEditor.ready(function(K) {
var editor1 = K.create('#BookingInfo', {
cssPath: 'Kindeditor/plugins/code/prettify.css',
uploadJson: 'Kindeditor/upload_json.ashx',
fileManagerJson: 'Kindeditor/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=form1]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=form1]')[0].submit();
});
}
});
prettyPrint();
});
KindEditor.ready(function(K) {
var editor2 = K.create('#Description', {
cssPath: 'Kindeditor/plugins/code/prettify.css',
uploadJson: 'Kindeditor/upload_json.ashx',
fileManagerJson: 'Kindeditor/file_manager_json.ashx',
allowFileManager: true,
afterCreate: function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=form1]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=form1]')[0].submit();
});
}
});
prettyPrint();
});

</script>
...全文
344 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
蝶恋花雨 2015-03-17
  • 打赏
  • 举报
回复
引用 5 楼 ITX2000 的回复:
去掉display:none; 只有文本框,没有文本编辑器
cssPath: '../kindeditor/plugins/code/prettify.css', uploadJson: '../kindeditor/asp.net/upload_json.ashx', fileManagerJson: '../kindeditor/asp.net/file_manager_json.ashx', 这些路径应该没配置好。
yghuaa 2015-03-17
  • 打赏
  • 举报
回复
引用 4 楼 kongwei521 的回复:
[quote=引用 3 楼 ITX2000 的回复:]
<textarea id="BookingInfo" name="BookingInfo" style=" width:610px; height:200px; display:none; "> </textarea>
<textarea id="Description" name="Description" style=" width:610px; height:200px;display:none; "></textarea>

额 你禁用它干嘛。禁用了找不到了吧。如何不禁用还报错有可能路径写的不对。[/quote]
去掉display:none; 只有文本框,没有文本编辑器
蝶恋花雨 2015-03-17
  • 打赏
  • 举报
回复
引用 3 楼 ITX2000 的回复:
<textarea id="BookingInfo" name="BookingInfo" style=" width:610px; height:200px; display:none; "> </textarea> <textarea id="Description" name="Description" style=" width:610px; height:200px;display:none; "></textarea>
额 你禁用它干嘛。禁用了找不到了吧。如何不禁用还报错有可能路径写的不对。
yghuaa 2015-03-17
  • 打赏
  • 举报
回复
引用 2 楼 kongwei521 的回复:
<textarea id="BookingInfo " runat="server" style="width:600px; height:244px;" ></textarea>
	 var editor;
 	 var isEmpty;
 	 KindEditor.ready(function (K) {
 	 	 editor = K.create('#BookingInfo ', {
 	 	 	 cssPath: '../kindeditor/plugins/code/prettify.css',
 	 	 	 uploadJson: '../kindeditor/asp.net/upload_json.ashx',
 	 	 	 fileManagerJson: '../kindeditor/asp.net/file_manager_json.ashx',
 	 	 	 resizeType: 1,
 	 	 	 allowPreviewEmoticons: false,
 	 	 	 items: [
				 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				 'insertunorderedlist', '|', 'emoticons', 'image', 'link']
 	 	 });
 	  
 	 });
有的 <textarea id="BookingInfo" name="BookingInfo" style=" width:610px; height:200px; display:none; "> </textarea> <textarea id="Description" name="Description" style=" width:610px; height:200px;display:none; "></textarea>
蝶恋花雨 2015-03-17
  • 打赏
  • 举报
回复
<textarea id="BookingInfo " runat="server" style="width:600px; height:244px;" ></textarea>
	 var editor;
 	 var isEmpty;
 	 KindEditor.ready(function (K) {
 	 	 editor = K.create('#BookingInfo ', {
 	 	 	 cssPath: '../kindeditor/plugins/code/prettify.css',
 	 	 	 uploadJson: '../kindeditor/asp.net/upload_json.ashx',
 	 	 	 fileManagerJson: '../kindeditor/asp.net/file_manager_json.ashx',
 	 	 	 resizeType: 1,
 	 	 	 allowPreviewEmoticons: false,
 	 	 	 items: [
				 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				 'insertunorderedlist', '|', 'emoticons', 'image', 'link']
 	 	 });
 	  
 	 });
蝶恋花雨 2015-03-17
  • 打赏
  • 举报
回复
你页面中有叫BookingInfo这个的文本框之类的吗?
内容概要:本文围绕“多主体综合能源系统+分布式ADMM研究”展开,系统阐述了交替方向乘子法(ADMM)在多主体综合能源系统中的分布式优化应用,提供了完整的Matlab代码实现。研究聚焦于多利益主体之间的协同优化问题,通过建立合理的数学模型,采用ADMM算法实现去中心化的求解架构,有效保障各主体的数据隐私性与决策自主性,同时提升整体系统的计算效率与优化性能。内容涵盖系统建模、优化问题分解、ADMM迭代求解流程、收敛性验证及结果分析,具有较强的理论深度与工程实践价值,适用于能源互联网、微电网群、园区综合能源系统等复杂场景的能量管理与协调调度。; 适合人群:具备电力系统分析、优化理论基础及Matlab编程能力的研究生、高校科研人员,以及从事综合能源系统规划、微电网优化、分布式能源管理等方向的工程技术人员。; 使用场景及目标:①应用于多主体参与的综合能源系统能量管理与协同优化调度;②帮助读者深入理解ADMM算法的分解-协调机制及其在分布式优化中的具体实现,支撑高水平学术论文复现、科研课题攻关或实际工程项目开发;③推动智能电网与能源互联网中去中心化、隐私保护型优化调度技术的发展与落地; 阅读建议:建议读者结合文中提供的Matlab代码进行动手实践,逐行调试并可视化关键变量的迭代过程,深入掌握ADMM算法的参数设置、收敛判据及数值稳定性处理技巧,并尝试将其拓展至电动汽车集群调度、多微电网互动、可再生能源消纳等其他分布式优化应用场景中进行仿真验证。

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧