integrating Fancybox and tinyMCE problem

廉价感情. 提交于 2019-12-23 15:33:53

问题


I have a problem when put tinyMCE in Fancybox popup box Here is the code

$(document).ready(function() {


        $(".reply_button").fancybox({
        'scrolling'     : 'no',
        'titleShow'     : false,
        'onClosed'      : function() {
           $.fancybox.close();
            $("#login_error").hide();
        }
        ,'onComplete': function(){
              $("textarea.editor").tinymce({
            script_url: "resources/scripts/tiny_mce",
            mode: "textareas",
            theme: "advanced",

        });
        }
    });

    });

The problem is when the box opened then I close it , the grey layer that covered the page stay and i have to refresh the page to get back to the website .

and I have this error trace in the console

Error: uncaught exception: [Exception... "Node cannot be used in a document other than the one in which it was created" code: "4" nsresult: "0x80530004 (NS_ERROR_DOM_WRONG_DOCUMENT_ERR)" location: ""


回答1:


Looks like a bug in TinyMCE. I unpacked the script and it's dying on line 7687 (both halves of the ifstatement throw the error, line wrapped here for readability):

if (i.compareBoundaryPoints(i.START_TO_START, g.selectedRange) === 0 && 
    i.compareBoundaryPoints(i.END_TO_END, g.selectedRange) === 0)

You might want to file a bug report, use a different editor, or do both. I haven't used TinyMCE myself but there seem to be a number of valid complaints about its size (bloated) and bugs (numerous).



来源:https://stackoverflow.com/questions/5760532/integrating-fancybox-and-tinymce-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!