I want to use FCKEditor for a web app. I am working on, and need to be able to put JavaScript code along with HTML in via FCKE. I can put in the JS, save it to the database fine, but when the page refreshes, FCKE crashes if there is JS in the text value.
I did the following to allow inputting php code
I tried this but it didn't work
Any ideas?
I did the following to allow inputting php code
FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
I tried this but it didn't work
FCKConfig.ProtectedSource.Add( /<\script[\s\S]*?\script>/g ) ; // PHP style server side code
Any ideas?

Re: Javascript code in the editor?
javascript code is automatically protected, so you'll need to explain the problem better.
Re: Javascript code in the editor?
Re: Javascript code in the editor?
Re: Javascript code in the editor?
<script type="text/javascript"> <!-- // Automatically calculates the editor base path based on the _samples directory. // This is usefull only for these samples. A real application should use something like this: // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value. //var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ; var oFCKeditor = new FCKeditor( 'Body' ) ; oFCKeditor.BasePath = '/js/fckeditor/' ; oFCKeditor.Height = 600 ; oFCKeditor.Value = '<! Body>' ; oFCKeditor.Create() ; //--> </script><! Body> is a dynamic tag - so the Body of the current story is inserted dynamically. I don't see how escaping is going to help - as the only thing that should make it bomb w/o escaping is a single quote or line returns (which are already taken care of when the dynamic tag is replaced with the story body).
How would you escape it?
thanks again.
Re: Javascript code in the editor?
Re: Javascript code in the editor?
Re: Javascript code in the editor?
Re: Javascript code in the editor?
http://dev.fckeditor.net/ticket/723
Re: Javascript code in the editor?
With regards to the server integration: take a look at the _samples folder