问题
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 if
statement 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