On the website I am currently developing some web pages use multiple editors. One of them loads over 40 editors. There is no problem in firefox, chrome, or IE 9(about 2 second load) but in IE 8 the load can take over 15 seconds for one page.
The number of editors is dynamic and each editor needs to call a different onBlur function based on some stuff I compute from the code behind. I am using asp.net with C#.
I am not sure if I have done something to make my page slow in IE 8 or if it is just because IE 8 doesn't run javascript as well in general. I have my code for adding an editor below so you can tell me if it is a problem.
Any tips on speeding up ckEditors loading would be greatly appreciated.
----------------------------------------------------------------------------------
I use the following code to add an editor to the page:
Each of the scripts is one line, I find it easier to read that way, so you can copy it to notepad to read better if you want.
The number of editors is dynamic and each editor needs to call a different onBlur function based on some stuff I compute from the code behind. I am using asp.net with C#.
I am not sure if I have done something to make my page slow in IE 8 or if it is just because IE 8 doesn't run javascript as well in general. I have my code for adding an editor below so you can tell me if it is a problem.
Any tips on speeding up ckEditors loading would be greatly appreciated.
----------------------------------------------------------------------------------
I use the following code to add an editor to the page:
//Initialize a div for the editor HtmlGenericControl comments = new HtmlGenericControl("textarea"); comments.Attributes.Add("rows", "1"); comments.Attributes.Add("cols", "1"); //give this the id for the editor comments.ID = editorAreaID; comments.InnerHtml = startData; //add the editor div to its container containingDiv.Controls.Add(comments); //Add script to make the editor ScriptManager.RegisterStartupScript(this, this.GetType(), editorAreaID, "$('#ctl00_ContentPlaceHolder1_" + editorAreaID + "').ckeditor(function() { makeBlur" + editorAreaID + "(this) },{height:" + height + ", width:" + width + ", resize_enabled:false, enterMode: CKEDITOR.ENTER_BR, toolbar: [[ 'Undo','Redo' ],['JustifyLeft','JustifyCenter','JustifyRight','HorizontalRule'],[ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ]]} );", true); //Add script to register the onBlur function ScriptManager.RegisterClientScriptBlock(this, this.GetType(), editorAreaID + "script", "function makeBlur" + editorAreaID + "(e){e.on('blur', function(e){if (this.checkDirty()) {" + blurFunctionToCall + ";}});}", true);
Each of the scripts is one line, I find it easier to read that way, so you can copy it to notepad to read better if you want.