Setup:
I have a news webpage with a menu and a textarea. The textarea is embedded in a frame and displays various articles
depending upon the menu selection. When the user hits an edit button the textarea is replaced with FCKeditor.
I would like to include all the FCKeditor JavaScript in the root page (news.html) and invoke it on the textarea frame when required. The big advantage is that all the FCKeditor code is only loaded once into the news page. My current design has the FCKeditor code inside the iframe which is inefficient and slow. I have been unable to create/manipulate the FCKeditor from the news page. Listed Below is just a few of the failed attempts. Please help.
news.html Head snippet:
//Function invoked when the "Edit" button is selected by user.
//The goal is to replace the textarea inside the frame with FCKeditor
function editor () {
//Here is a Working Test Write to the Textarea inside the frame
window.myframe.document.myform.myFCKeditor.innerHTML = "Replaces Hello World";
var oFCKeditor = new FCKeditor( 'myFCKeditor' ); //Original
//var oFCKeditor = new FCKeditor( 'window.myframe.document.myform.myFCKeditor' ); //Failed
//var oFCKeditor = new FCKeditor( "window.myframe.document.getElementById("myFCKeditor")"); //Failed
//ReplaceTextarea() ; //Original
ReplaceTextarea.apply('window.article'); //Failed
}
news.html Body snippet:
<iframe src="article.html?tag=1" id="myframe" width="100%" height="80%" scrolling="no" frameborder="1" allowtransparency="true" style="background-color: #98cdff;" ></iframe>
Article.html Body snippet:
<form id="myform">
<textarea ID="FCKeditor"> Hello World </textarea>
</form>
I have a news webpage with a menu and a textarea. The textarea is embedded in a frame and displays various articles
depending upon the menu selection. When the user hits an edit button the textarea is replaced with FCKeditor.
I would like to include all the FCKeditor JavaScript in the root page (news.html) and invoke it on the textarea frame when required. The big advantage is that all the FCKeditor code is only loaded once into the news page. My current design has the FCKeditor code inside the iframe which is inefficient and slow. I have been unable to create/manipulate the FCKeditor from the news page. Listed Below is just a few of the failed attempts. Please help.
news.html Head snippet:
//Function invoked when the "Edit" button is selected by user.
//The goal is to replace the textarea inside the frame with FCKeditor
function editor () {
//Here is a Working Test Write to the Textarea inside the frame
window.myframe.document.myform.myFCKeditor.innerHTML = "Replaces Hello World";
var oFCKeditor = new FCKeditor( 'myFCKeditor' ); //Original
//var oFCKeditor = new FCKeditor( 'window.myframe.document.myform.myFCKeditor' ); //Failed
//var oFCKeditor = new FCKeditor( "window.myframe.document.getElementById("myFCKeditor")"); //Failed
//ReplaceTextarea() ; //Original
ReplaceTextarea.apply('window.article'); //Failed
}
news.html Body snippet:
<iframe src="article.html?tag=1" id="myframe" width="100%" height="80%" scrolling="no" frameborder="1" allowtransparency="true" style="background-color: #98cdff;" ></iframe>
Article.html Body snippet:
<form id="myform">
<textarea ID="FCKeditor"> Hello World </textarea>
</form>
RE: Improve performance using frames
For all your work, this might not improve performance at all. You are effecitively trying to cache the editor files, but they should be cached already by the browser.