<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>
请告诉我为什么回调不起作用?
解决方法
onchange_callback setting (3.x branch)中的
onchange_callback setting (3.x branch)似乎已被删除.您需要使用安装选项来包含外部功能.例:
<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>