我不知道为什么它不起作用

它不工作,因为

console.debug(tinyMCE.activeEditor.getContent());

tinymce.activeEditor.getContent();

这些声明没有被执行.

尝试跟随这个FIDDLE ….

tinyMCE.init({

// General options

mode : "specific_textareas",

editor_selector : "mceEditor"

});

获取内容的功能….

function get_editor_content() {

// Get the HTML contents of the currently active editor

console.debug(tinyMCE.activeEditor.getContent());

//method1 getting the content of the active editor

alert(tinyMCE.activeEditor.getContent());

//method2 getting the content by id of a particular textarea

alert(tinyMCE.get('myarea1').getContent());

}

获取按钮上的编辑内容点击…

Get content

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐