How to extract HTML content from TinyMCE Editor

后端 未结 4 901
情歌与酒
情歌与酒 2020-12-31 03:02

I\'m a beginner on Javascript/TinyMCE and I try to understand how is it possible to get the HTML content from the editor, and show it with a simple alert() function.

<
4条回答
  •  孤城傲影
    2020-12-31 03:25

    I was looking for a solution and tried some of the above then went looking more on the tinymce documentation and found this to be effective.
    Using the tiny mce 4

    function getHTML()
    {
       tinymce.activeEditor.on('GetContent', function(e) {
         console.log(e.content);
       });
    }
    

    just call that function with an onclick and see what the results are...
    My source is: http://www.tinymce.com/wiki.php/api4:class.tinymce.ContentEvent

提交回复
热议问题