javascript - Closing Fancybox after editing inline TinyMCE produces WRONG_DOCUMENT_ERR: DOM Exception 4 -


i have fancybox loads form collects user input. in form tinymce editor. i'm using oncomplete event of fancybox init editor , works fine until try close fancybox after doing significant editing in tinymce. doesn't matter if click close x, or let ajaxform call fancybox close method upon submitting.

the fancybox closes, hangs in loop console logging "wrong_document_err: dom exception 4" before getting rid of shadow overlay. tried disabling overlay , made no difference. page still hangs looping error.

similar errors produced in firefox. understand error has trying manipulate dom nodes different elements. suspect it's because dom tree doesn't match 1 fancybox trying close after adding elements to tinymce (adding image, list item, etc causes it).

has dealt similar issue before?

i did googling didn't find solution, after testing found solution.

try oncleanup command in fancybox options:

$.fancybox(data_html,{     oncomplete:function(){         //init tinymce in form here                     },     oncleanup:function(){         // remove tinymce , html in form          // before closing modal window         $('#your_form').html('');     } }); 

hope helps!


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -