tags:

views:

17

answers:

1

I am try to create a new fckeditor plugin similar to fck flash plugin, that will write html in the following format

<object id="id">
</object>
<script type="text/javascript">
    someJavascriptcode();
</script>

I can create object element using

e = FCK.EditorDocument.createElement( 'object' ) ;
SetAttribute( e, 'id', 'id1' ) ;

how do I wrap the javascript code (as html text or something)

oEditor.FCK.InsertHtml('<p>test</p>');

works, but when I wrap the javascript code (with imports), it does not work, html html code is not inserted.

ok. looks like fckeditor is removing the script tags.. how do I stop this behavior.

+1  A: 

I was able to add by adding javascript on the protected source on fckconfig.js file

FCKConfig.ProtectedSource.Add( /<javascript>[\s\S]*?&lt;\/javascript&gt;/g );
surajz
and also adding empty div around the javascript code seems to help.
surajz

related questions