I am trying to change content of tinymce editor dynamically. even this steps is not working. Actually i want to put contents on ajax success, But since it is not working i cant continue.
I am getting Type error tinemce.get() is null and tinymce.activeEditor is null erros
<textarea style="height:700px" name="proposal" id="proposal" >
hi
</textarea>
<script>
$(document).ready(function () {
tinymce.init({
selector: "#proposal",
height: 250,
theme: "modern",
plugins: [
"autoresize advlist autolink lists link image charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars code fullscreen",
"insertdatetime media nonbreaking save table contextmenu directionality",
"emoticons template paste textcolor colorpicker textpattern imagetools codesample toc"
],
toolbar1: "undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media | forecolor backcolor emoticons | codesample",
image_advtab: true,
content_css: [
"https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css",
],
});
var content = "<p>Hello World </p>";
tinyMCE.get("proposal").setContent(content);//not working
tinyMCE.activeEditor.setContent(content);//not working
});
<script>