initiate tinymce dynamically

function AddRemoveTinyMce(editorId) {
    if(tinyMCE.get(editorId)) 
    {
        tinyMCE.EditorManager.execCommand('mceFocus', false, editorId);                    
        tinyMCE.EditorManager.execCommand('mceRemoveEditor', true, editorId);

    } else {
        tinymce.EditorManager.execCommand('mceAddEditor', false, editorId);             
    }


}
Advertisements