Hello,
I am using the javascript function to call the editor for a content manager for a website. I have the Javascript in the head tag.
The head tag is a universal include (via php) for all the administration pages.
My problem is this: I was using an older 1.x version of FCKeditor. Some pages (lists of content, the main entry for the administrator page etc) DO NOT have the textarea with the ID to be replaced.
With the 1.x version editor, I got no errors. With the latest version, I get a dialogue pop-up that warns me that the textarea is missing (which it is on some pages)
When I get to a page where there is the appropriate textareas, the script works fine.
Can I disable the warning in the lastest version?
My Javascript:
<script type='text/javascript' src='../FCKeditor/fckeditor.js'></script> <script type='text/javascript'> window.onload = function() { var oFCKeditor = new FCKeditor( 'content' ) ; oFCKeditor.BasePath = '../FCKeditor/' ; oFCKeditor.ToolbarSet = 'Deluxe' ; oFCKeditor.ReplaceTextarea() ; var oFCKeditor = new FCKeditor( 'sidebar' ) ; oFCKeditor.BasePath = '../FCKeditor/' ; oFCKeditor.ToolbarSet = 'Deluxe' ; oFCKeditor.ReplaceTextarea() ; } </script>
Path to my config file: http://www.rdcan.ca/FCKeditor/fckconfig.js
Thanks!
Brian
Re: Javascript Embed Issue
(thanks!)
Re: Javascript Embed Issue
Why don't you check that the textarea does exist before trying to replace it?
Re: Javascript Embed Issue
I just added a condition to the javascript in the head tag.
The problem was - the head tag is an include as the admin pages load different sections, so on some pages the text area does not exist, some it does.
Here is the script with changes:
Problem solved!
Thanks
Brian