我已经实现了ckeditor来提供管理员用户内联编辑选项来编辑浏览器本身的页面,然后将内容更新为db。 一切都在所有浏览器上正常工作,但在IE上没有。 在IE 9上,我在控制台上看到此错误 SCRIPT5007:无法获取属性的值' groups&#39 ;: object is null或undefined ckeditor.js,第647行字符409
IE11上的没有显示错误,但仍然没有收费栏。
代码有点像这样请忽略错误,如果发现任何错误,
<script type="text/javascript" src="/ckeditor_new/ckeditor.js"></script>
<script>
CKEDITOR.plugins.registered['save'] = {
init: function (editor) {
var command = editor.addCommand('save',
{
modes: { wysiwyg: 1, source: 1 },
exec: function (editor) { // Add here custom function for the save button
var div_id=editor.container.getId();
var content=editor.getData();
var request = jQuery.ajax({
url: "views/submitcontact.jsp",
type: "POST",
data: {
Id : div_id,
content : content,
},
success : function(text) {
// Do anything you need to do if save successful
alert(text);
//ed.setProgressState(false); // cancel showing progress
},
error : function( type, req, o ){
alert("Save Failed\n Error: " + type + "\n HTTP Status: " + req.status);
}
});
}
});
editor.ui.addButton('Save', { label: 'Save', command: 'save' });
}
}
</script>
在体内有一个像这样的div:
<body>
<div class="editable" contenteditable="true" id="contact<%=Sect.getSectionId()%>">
<%=Sect.getHtmlContent().getHtmlContent()%>
</div>
</body>
任何建议IE的问题是什么?
这就是包中的配置文件中写的内容
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
// '/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' },
];
// Remove some buttons provided by the standard plugins, which are
// not needed in the Standard(s) toolbar.
config.removeButtons = 'Blockquote,Link,link,divs,Image,SelectAll,Anchor,CreateDiv,Underline,Subscript,Superscript,Inlinesave,CreatePlaceholder,Table,Outdent,Indent,button1,button2,button3,button4,button5,NumberedList,HorizontalRule';
config.removePlugins='magicline,stylescombo,format';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;pre';
// Simplify the dialog windows.
config.removeDialogTabs = 'image:advanced;link:advanced';
config.allowedContent=true;
//config.extraAllowedContent = 'button(*){*}[*];table(*){*}[*]';
config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.disableAutoInline = true;
};