<script>
function TinyMceGetStatsLost(inst) {
alert("The HTML is now:" + inst.getBody().innerHTML);
}
tinymce.init({
selector: "textarea",
language: "ru",
plugins: [
"advlist autolink lists link charmap anchor",
"searchreplace fullscreen",
"insertdatetime paste"
],
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link",
onchange_callback : "TinyMceGetStatsLost"
});
</script>
i use this code but callback not working. In console i do not see errors...
Tell me please why callback not work ?
<script>
function TinyMceGetStatsLost(inst) {
alert("The HTML is now:" + inst.getBody().innerHTML);
}
tinymce.init({
selector: "textarea",
language: "ru",
plugins: [
"advlist autolink lists link charmap anchor",
"searchreplace fullscreen",
"insertdatetime paste"
],
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link",
onchange_callback : "TinyMceGetStatsLost"
});
</script>
i use this code but callback not working. In console i do not see errors...
Tell me please why callback not work ?
Share Improve this question edited Aug 7, 2014 at 12:20 asked Aug 7, 2014 at 12:13 user2881809user28818091 Answer
Reset to default 20The onchange_callback setting (3.x branch) seems to have been removed in the 4.x branch of TinyMCE. You would need to use the setup option to include your external function. Example:
<script type="text/javascript">
tinymce.init({
selector: "textarea",
setup: function (ed) {
ed.on("change", function () {
TinyMceGetStatsLost(ed);
})
}
});
function TinyMceGetStatsLost(inst) {
alert("The HTML is now:" + inst.getBody().innerHTML);
}
</script>