Insert HTML in NicEdit WYSIWYG

后端 未结 7 1591
忘了有多久
忘了有多久 2020-12-11 06:40

How can I insert text/code at the cursors place in a div created by NicEdit?

I\'ve tried to read the documentation and create my own plugin, but I want it to work wi

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-11 07:18

    It works for me when I use:

    function neInsertHTML(value){
        $('.nicEdit-main').focus(); // Without focus it wont work!
        // Inserts into first instance, you can replace it by nicEditors.findEditor('ID');
        myNicEditor.nicInstances[0].nicCommand('InsertHTML', value); 
    }
    

提交回复
热议问题