2011-04-22 49 views
4

我在的fancybox彈出框中 這裏把tinyMCE的時候的一個問題是代碼整合的fancybox和tinyMCE的問題

$(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", 

     }); 
     } 
    }); 

    }); 

問題是,當箱子打開,然後我關閉它,涵蓋網頁灰色層留下來,我必須刷新頁面才能返回到網站。

,我有這樣的錯誤跟蹤在控制檯

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: ""

+0

有沒有機會向我們展示jsFiddle或live鏈接? – 2011-04-22 22:13:46

+0

http://jsfiddle.net/pbGxq/3/ – 2011-04-22 23:12:14

+0

在Chrome 10.0.648.204中正常工作,顯示您在Firefox 3和4中描述的錯誤。 – 2011-04-22 23:21:09

回答

3

看起來像TinyMCE的一個bug。我unpacked the script,它的死在線路7687(在if聲明的兩半扔錯誤,線纏繞這裏閱讀):

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

你可能想file a bug report,使用differenteditor,或兩者都做。我自己並沒有使用TinyMCE,但似乎有大量有關它的大小(臃腫)和錯誤(無數)的抱怨。

+0

+1分析 – Thariama 2011-04-26 13:46:39