2015-10-27 41 views

回答

1

基本上我實現爲通過使用由TinyMCE的

這裏提供的是結構的片斷changekeyup事件。

tinyMCE.init({ 
     selector: "textarea.tinymce", 
     toolbar: ["undo redo | bold italic | styleselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent","link image media | code"], 
     plugins: "image imagetools link paste media code", 
     setup: function(ed) { 
     ed.on('change', function(e) { 
      previewContent(ed.getContent()); 
     }); 

     ed.on('keyup', function(e) { 
      previewContent(ed.getContent()); 
     }); 
     } 
});