shimataro / cazary

jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language.
http://shimataro.github.io/cazary/
MIT License
12 stars 6 forks source link

Need to update the content after an AJAX call via jQuery/Javascript #6

Open darkkevind opened 8 years ago

darkkevind commented 8 years ago

Hi, great plugin by the way.

I can't seem to update the content of the editor via JQuery or Javascript, how do I do this please?

Thanks, Kevin.

shimataro commented 8 years ago

Sorry for late reply.

Do you mean that you want to change textarea directly like this?

$("textarea#wysiwyg").val("<b>bold</b>"); // doesn't change WYSIWYG area!

Try dev-event-change branch:

$("textarea#wysiwyg").val("<b>bold</b>").trigger("change"); // trigger "change" event!