I posted this over in the Open Discussions forum. I think I should have put it here. I hope someone here can help with my issue.
I'm running the demo code for FCK editor and I have the editor appearing in my web page.
However, I need the user to select from a list of documents and click a button. That button would build a link inside the editor window in a similar way it works in fck_link.js
I need to use the oEditor.FCK.CreateLink method to build that link but the FCK object is undefined. Here's a bit of my debug code:
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
alert("oEditor is " + oEditor.Name + "\nStatus is " + oEditor.Status );
alert("oEditor.FCK is " + oEditor.FCK);
The first alert box shows me that the oEditor.Name is "FCKeditor1" and that the status is "2" which should be "FCK_STATUS_COMPLETE". This tells me that I do have a proper editor instance. Also, I can see and use the editor, including the "build a link" button from inside the editor.
The next alert box shows me that oEditor.FCK is undefined. This is odd since I know I have an editor created.
I see that the FCK object is defined in 3 places. It's in editor/_source/internals/fck.js and also in fck_gecko.js and fck_ie.js
Since I'm using Firefox I should be accessing the fck.js file. That made me wonder if I'm not set up correctly and there's some reason my code can't see the fck.js file.
However, It appears that my installation is set up correctly because if I use the "Link" button from the default tool bar then the link is properly created. So there must be something my setup that is allowing the internal FCKEditor Link code to call fck.js but not my own code.
Does anyone know why I can't access the oEditor.FCK object and what the solution should be? I've been searching the forums with no success.
Thank you
Greg
I'm running the demo code for FCK editor and I have the editor appearing in my web page.
However, I need the user to select from a list of documents and click a button. That button would build a link inside the editor window in a similar way it works in fck_link.js
I need to use the oEditor.FCK.CreateLink method to build that link but the FCK object is undefined. Here's a bit of my debug code:
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
alert("oEditor is " + oEditor.Name + "\nStatus is " + oEditor.Status );
alert("oEditor.FCK is " + oEditor.FCK);
The first alert box shows me that the oEditor.Name is "FCKeditor1" and that the status is "2" which should be "FCK_STATUS_COMPLETE". This tells me that I do have a proper editor instance. Also, I can see and use the editor, including the "build a link" button from inside the editor.
The next alert box shows me that oEditor.FCK is undefined. This is odd since I know I have an editor created.
I see that the FCK object is defined in 3 places. It's in editor/_source/internals/fck.js and also in fck_gecko.js and fck_ie.js
Since I'm using Firefox I should be accessing the fck.js file. That made me wonder if I'm not set up correctly and there's some reason my code can't see the fck.js file.
However, It appears that my installation is set up correctly because if I use the "Link" button from the default tool bar then the link is properly created. So there must be something my setup that is allowing the internal FCKEditor Link code to call fck.js but not my own code.
Does anyone know why I can't access the oEditor.FCK object and what the solution should be? I've been searching the forums with no success.
Thank you
Greg

Re: Undefined FCK Editor Object
http://docs.fckeditor.net/FCKeditor_2.x ... Script_API
Re: Undefined FCK Editor Object