I'm trying to programatically input html into Froala text editor. Based on their documentation this should work:
$(function(){
$('#editor').editable("setHTML", "<p>My custom paragraph.</p>", false);
});
But when I reload page I only get empty space, no errors. This is binded to textarea with id #editor
. If I use this code:
$(function(){
$('#editor').editable({inlineMode : false});
});
... then everything is ok.
Does anyone knows how to programatically input html into this editor.
Froala WYSIWYG HTML Editor is the best rich text editor out there. It is built using the latest technologies and taking the great advantages of jQuery and HTML5 to create an outstanding editing experience.
To append a text use html.insert
$("#editor").froalaEditor('html.insert','<p>new text to append</p>');
With the latest version of Froala this works fine
$("#froalaEditor")[0]["data-froala.editor"].html.set('This should work fine');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With