add embedded elements in fckeditor plugin
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 thi开发者_开发知识库s behavior.
I was able to add by adding javascript on the protected source on fckconfig.js file
FCKConfig.ProtectedSource.Add( /<javascript>[\s\S]*?<\/javascript>/g );
Try this, works in the regex tester anyway.
FCKConfig.ProtectedSource.Add( /<script>[\s\S]*?<\/script>/g );
精彩评论