开发者

cannot convert dynamically loaded textarea to tinyMCE editor

I have a jQuery modal dialog, which is loaded by AJAX call. There is one textarea, however I cannot convert it to tinyMCE editor.

tried

tinyMCE.execCommand('mceAddControl', false, 'Text')

 $('textarea').tinymce(...)

all works great if textarea is created from normal call. (I suspect there is so开发者_运维百科mething about DOM)


plz call

$('textarea').tinymce(...)

after you add textarea to the DOM hierarchy


I had a similar problem, and it turns out that it was because I was loading the tinymce script through yepnope. When I put it directly on the page, the tinyMCE.execCommand('mceAddControl', false, 'id'); worked. Also, make sure you copy all of the files downloaded (including the 'lang' folder and the 'themes' folder) into the same directory as your tiny_mce.js file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜