tinymce 文本编辑器无法在 Facebox 模式窗口中加载

发布于 2024-10-05 13:12:12 字数 1542 浏览 0 评论 0原文

我正在尝试将tinymce 编辑器与facebox 模式窗口一起使用。但是,当打开模式窗口时,tinymce 不会加载,并且我在 firebug 中没有收到 Jscript 的错误,

<script type="text/javascript">

 jQuery(document).ready(function($) {
     $('a[rel*=facebox]').facebox();
 })

 tinyMCE.init({ 
    theme : "advanced", 
    mode : "textareas", 
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist", 
    // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_resizing : true

});
</script>

有什么帮助吗?

I'm trying to use tinymce editor with facebox modal window. But tinymce doesn't load when the modal window is opened and I get no errors of Jscript in firebug

<script type="text/javascript">

 jQuery(document).ready(function($) {
     $('a[rel*=facebox]').facebox();
 })

 tinyMCE.init({ 
    theme : "advanced", 
    mode : "textareas", 
    plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist", 
    // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_resizing : true

});
</script>

any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

澜川若宁 2024-10-12 13:12:12

现在我正在开发另一个项目,我再次遇到了同样的问题

这次我使用了 colorbox 并将此代码放在 fancybox 的Complete 事件上。

 $(".edit").colorbox({
    onComplete : function(){ tinyMCE.execCommand('mceAddControl', true, "textare_id"); },
    onClosed   : function(){ tinyMCE.execCommand('mceRemoveControl', true, "textare_id");}  
 });

感谢古奇的回答,这很有效
TinyMCE - 未定义“e” fancyboxm 中第二次加载时的,'j',t'

PS Tinymce init 函数定义在整个项目的索引文件中

Now I'm working on another project and I had the same issue again

This time I used colorbox and put this code onComplete event of fancybox.

 $(".edit").colorbox({
    onComplete : function(){ tinyMCE.execCommand('mceAddControl', true, "textare_id"); },
    onClosed   : function(){ tinyMCE.execCommand('mceRemoveControl', true, "textare_id");}  
 });

and It worked thanks to gutch for his answer on
TinyMCE - undefined 'e','j','t' when loading for a second time in fancyboxm

P.S. Tinymce init function defined in the index file of whole project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文