开发者

add embedded elements in fckeditor plugin

开发者 https://www.devze.com 2023-01-07 05:12 出处:网络
I am try to create a new fckeditor plugin similar to fck flash plugin, that will write html in the following format

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]*?&lt;\/javascript&gt;/g );


Try this, works in the regex tester anyway.

FCKConfig.ProtectedSource.Add( /<script>[\s\S]*?<\/script>/g );
0

精彩评论

暂无评论...
验证码 换一张
取 消