To use tiny mce in a jquery dialog and clear the contents of tinymce on close of the overlay use the following function :
$(”id-for-dialog”).bind( “dialogclose or dialogbeforeclose”, function(event, ui) {
tinyMCE.execCommand( ‘mceRemoveControl’, true, ‘id-for-editor’ );
});
This will enable loading of new content into the tinymce editor whenever the jquery dialog reopens .
