We are using FCKeditor in Plone. The edited documents have JavaScripts (inside <script> tags) included in the source code. From some point (2.4.7 release) these JSs get executed when loaded into FCKeditor – the JS functions enclosed in the <script></script> tags remain intact but the output of the functions gets written into the source (immediately after the closing </script> tag). Saving the document results in having the output of the JS functions hard coded into the HTML source. The same holds true not only of functions but of simple use of document.write(), as well.
Before asking the Plone developers for a fix, I tried searching the FCKeditor.net docs and forums to find out what is the expected behaviour of FCKeditor in these circumstances (JS in the edited source code). I have found several topics touching on this point but none of them contained an authoritative answer. This topic is a plea for such an answer. Thanks to anybody who undertakes it.
Before asking the Plone developers for a fix, I tried searching the FCKeditor.net docs and forums to find out what is the expected behaviour of FCKeditor in these circumstances (JS in the edited source code). I have found several topics touching on this point but none of them contained an authoritative answer. This topic is a plea for such an answer. Thanks to anybody who undertakes it.
Re: JavaScript in the source code – official docs
I'm using 2.6.3, and my document JavaScripts are *not* being executed (either inline or sourced). So whatever it is, is either gone in 2.6.3, or is somehow triggered by a specific condition.
Re: JavaScript in the source code – official docs
In a bit of a rush so if this isn't applicable, just ignore it...
)
For </script> messing up the creation of the FCKeditor, I found doing this fixed it. I don't think it's an FCKeditor bug because they have no control over it unless you're using one of the scripting languages to create the editor, since I use a home grown language, I need to create the editor using javascript and not say php's creation tool. (or rather the tool written in php, not that php themselves created the code
Anyway...
the last one in the array is probably what you're instrested in. While this is written in php, it applies to any language that creates the javascript. The separation of </ and script> (could be at any part in the tag) is to ensure that the browser doesn't detect the script tag as the closing javascript tag and just as text.
Re: JavaScript in the source code – official docs
I'm considering inserting a custom tag of some sort to save the configuration of the plugin and inject the javascript with PHP at page load. Has anyone else had any experience with this?