How to load html using jquery into a TinyMCE textarea

后端 未结 2 1056
我在风中等你
我在风中等你 2020-12-08 11:40

I\'ve a textarea that uses TinyMCE as a WYSIWYG. Once that this textarea is loaded I want that, clicking a button \"Edit\" some html code that I bring with AJAX jquery is l

相关标签:
2条回答
  • 2020-12-08 12:15

    You could try with the setContent function:

    $.get("hello.html", function(content) { 
        // if you have one tinyMCE box on the page:
        tinyMCE.activeEditor.setContent(content);
    });
    

    or even shorter:

    $.get("hello.html", tinyMCE.activeEditor.setContent);
    
    0 讨论(0)
  • 2020-12-08 12:21

    Using the jQuery version of tinyMCE with jQuery plugin you could use this

    $.get("hello.html", function(content) { 
        $('#input-corpo').html(content);
    });
    
    0 讨论(0)
提交回复
热议问题