Hello,
I'm trying to interact with the instance of my editor from an external script.
In order to do this, I first try to retrieve the instance by simply calling FCKeditorAPI.GetInstance method.
But when I try to execute the code, I get the following error from firebug:
FCKEditorAPI is not defined
My code:
1 <script>
2 var oFCKeditor = new FCKeditor('page_content');
3 oFCKeditor.BasePath = "/javascripts/FCKeditor/";
4 oFCKeditor.Config["CustomConfigurationsPath"] =
5 '<%= javascript_path "railsfck.js" %>';
6 oFCKeditor.ReplaceTextarea();
7 window.test_fun = function get_form_values() {
8 var oEditor = FCKEditorAPI.GetInstance('page_content');
9 var html = oEditor.GetHTML();
10 alert(html);
11 }
12 </script>
...
13 <%= link_to_remote 'Apply', :submit => 'editform', :update => 'content',:before 14
=> "diff_launch();test_fun();" :url => {:action => 'process_edit'} %>
after have substituting line 4 with the following line of code
var oEditor = FCKEditorAPI.GetInstance('page_content');
I get the following error from firebug:
window.parent.InnerDialogLoaded is not a function
unescapeHTML: function() {..}
Does anyone know where is the problem?
Please note that I'm using ajax link_to_remote call.
Thanks you in Advance.
Indusha
I'm trying to interact with the instance of my editor from an external script.
In order to do this, I first try to retrieve the instance by simply calling FCKeditorAPI.GetInstance method.
But when I try to execute the code, I get the following error from firebug:
FCKEditorAPI is not defined
My code:
1 <script>
2 var oFCKeditor = new FCKeditor('page_content');
3 oFCKeditor.BasePath = "/javascripts/FCKeditor/";
4 oFCKeditor.Config["CustomConfigurationsPath"] =
5 '<%= javascript_path "railsfck.js" %>';
6 oFCKeditor.ReplaceTextarea();
7 window.test_fun = function get_form_values() {
8 var oEditor = FCKEditorAPI.GetInstance('page_content');
9 var html = oEditor.GetHTML();
10 alert(html);
11 }
12 </script>
...
13 <%= link_to_remote 'Apply', :submit => 'editform', :update => 'content',:before 14
=> "diff_launch();test_fun();" :url => {:action => 'process_edit'} %>
after have substituting line 4 with the following line of code
var oEditor = FCKEditorAPI.GetInstance('page_content');
I get the following error from firebug:
window.parent.InnerDialogLoaded is not a function
unescapeHTML: function() {..}
Does anyone know where is the problem?
Please note that I'm using ajax link_to_remote call.
Thanks you in Advance.
Indusha
RE: retrieving an editor instance
RE: retrieving an editor instance
function FCKeditor_OnComplete(editorInstance){
< your code here >
}