編輯:看到我的答案爲發現的問題和解決方案。這是由於iframe調用上下文,儘管是相同的域通過tinyMCE.EditorManager.execCommand('mceAddControl',false,newId)添加tinymce時出現「操作不安全」錯誤;
我不明白爲什麼會發生此錯誤。我要通過這些步驟:
刪除TinyMCE的編輯
更改的textarea的id
添加TinyMCE的編輯到textarea的,其新的ID
代碼
//Remove the tinyMCE editor for this text area (CHANGING TO "true" DOESN't HELP)
tinyMCE.EditorManager.execCommand('mceRemoveControl',false, myTextArea.id);
//Change the id
myTextArea.id = newId;
//Add a tiny mce editor (CHANGING TO "true" DOESN't HELP)
tinyMCE.EditorManager.execCommand('mceAddControl',false, newId);
最後一個拋出錯誤the operation is insecure
。爲什麼?我怎麼這樣做?