2010-12-01 93 views

回答

7

這段代碼是用來刷新的TinyMCE:

tinyMCE.execCommand("mceRepaint"); 
+0

如果您使用的是TinyMCE jQuery插件,那麼這行代碼的等價物是什麼? – 2013-02-15 00:24:49

5

您可以使用此語句刷新(替換)內容:

editor.execCommand('mceSetContent', false, html); 

或者,如果你想確保髒標誌清除:

editor.execCommand('mceSetContent', false, html); 
editor.startContent = tinymce.trim(editor.getContent({ format: 'raw' })); 
editor.isNotDirty = true; 
editor.nodeChanged();