主题: 4.0 同一个页面同时调用4个编辑器,最后一个不工作:( |
作者: 中国帝购网络, 发布日期: 2011-10-07 19:12:31, 浏览数: 5409 |
我有个页面,需要编辑的内容比较多,所以我就同时调用了4个编辑器,可能是我没弄明白同时调用代码应该如何处理,我现在只是更改了文本编辑区的ID 和NAME ,但是同一页面放置3个的时候是正常显示和使用的,当我放了第4个上去开始出问题了!最后一个就没办法正常显示了! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题 1</title> </head> <link rel="stylesheet" href="kindeditor/themes/default/default.css" /> <link rel="stylesheet" href="kindeditor/plugins/code/prettify.css" /> <script type="text/javascript" charset="utf-8" src="kindeditor/kindeditor.js"></script> <script type="text/javascript" charset="utf-8" src="kindeditor/lang/zh_CN.js"></script> <script type="text/javascript" charset="utf-8" src="kindeditor/plugins/code/prettify.js"></script> <script type="text/javascript"> KindEditor.ready(function(K) { var editor1 = K.create('textarea[name="content"]', { cssPath : 'kindeditor/plugins/code/prettify.css', uploadJson : '/admin/kindeditor/asp/upload_json.asp?spath=upfile/1', fileManagerJson :'/admin/kindeditor/asp/file_manager_json.asp', allowFileManager : true, afterCreate : function() { var self = this; K.ctrl(document, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); K.ctrl(self.edit.doc, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); } }); prettyPrint(); }); KindEditor.ready(function(K) { var editor1 = K.create('textarea[name="info"]', { cssPath : 'kindeditor/plugins/code/prettify.css', uploadJson : '/admin/kindeditor/asp/upload_json.asp?spath=upfile/2', fileManagerJson :'/admin/kindeditor/asp/file_manager_json.asp', allowFileManager : true, afterCreate : function() { var self = this; K.ctrl(document, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); K.ctrl(self.edit.doc, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); } }); prettyPrint(); }); KindEditor.ready(function(K) { var editor1 = K.create('textarea[name="hother"]', { cssPath : 'kindeditor/plugins/code/prettify.css', uploadJson : '/admin/kindeditor/asp/upload_json.asp?spath=upfile/3', fileManagerJson :'/admin/kindeditor/asp/file_manager_json.asp', allowFileManager : true, afterCreate : function() { var self = this; K.ctrl(document, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); K.ctrl(self.edit.doc, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); } }); prettyPrint(); }); KindEditor.ready(function(K) { var editor1 = K.create('textarea[name="service"]', { cssPath : 'kindeditor/plugins/code/prettify.css', uploadJson : '/admin/kindeditor/asp/upload_json.asp?spath=upfile/4', fileManagerJson :'/admin/kindeditor/asp/file_manager_json.asp', allowFileManager : true, afterCreate : function() { var self = this; K.ctrl(document, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); K.ctrl(self.edit.doc, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); } }); prettyPrint(); }); </script> <body> <textarea id="content" name="content" cols="100" rows="8" style="width:730px;height:200px;visibility:hidden;">111</textarea> <textarea id="info" name="info" cols="100" rows="8" style="width:730px;height:200px;visibility:hidden;">222</textarea> <textarea id="service" name="service" cols="100" rows="8" style="width:730px;height:200px;visibility:hidden;">444</textarea> <textarea id="hother" name="hother" cols="100" rows="8" style="width:730px;height:200px;visibility:hidden;">333</textarea> </body> </html> |
作者: Roddy, 发布日期: 2011-10-07 22:09:50 |
不要调用多次KindEditor.ready,多个K.create放在一个KindEditor.ready里就没问题了。
|
回复 |
作者: 中国帝购网络, 发布日期: 2011-10-08 23:38:32 |
回复Roddy:但是 我4个编辑框中的,上传是通过参数来决定存储位置的,如果放在同一个里面,我前面的参数不是没用了~:( |
回复 |