javascripthtmlcsswysiwygfroala

Get data from froala editor


Dont understand how get data from this editor. I read ofical documentation, but there they create new instance. I want send data from editor to my server. How i can do this. I still use Vue CDN.


Solution

  • You can get the text editor data simply by an event like this below's peace of codes:

    new FroalaEditor('.selector', {
      events: {
        'contentChanged': function () {
          const editorContent = this.html.get();
          console.log(editorContent);
        }
      }
    });
    

    you can also find more on its documentation.