Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 获取tinyMCE的内容?_Javascript_Tinymce - Fatal编程技术网

Javascript 获取tinyMCE的内容?

Javascript 获取tinyMCE的内容?,javascript,tinymce,Javascript,Tinymce,我有一个id为“article”的文本区域 以下是我的js中的内容: tinyMCE.init({ theme : "advanced", mode : "textareas", plugins : "fullpage", theme_advanced_buttons3_add : "fullpage" }); 并获取编辑器的内容: var content = tinyMCE.get('article').getConte

我有一个id为“article”的文本区域

以下是我的js中的内容:

tinyMCE.init({
        theme : "advanced",
        mode : "textareas",
        plugins : "fullpage",
        theme_advanced_buttons3_add : "fullpage"
    });
并获取编辑器的内容:

var content = tinyMCE.get('article').getContent();
    alert(content);
但它似乎不起作用,有没有什么想法我哪里出了问题?

试着按照这个想法去做,它可能会帮助你找出

tinyMCE.init({
    theme : "advanced",
    mode : "textareas",
    plugins : "fullpage",
    theme_advanced_buttons3_add : "fullpage"
});
获取内容的函数

function get_content() {
var content = tinyMCE.get('article').getContent();
alert(content);
}


<textarea name="article">
  //content here
</textarea>
函数获取内容(){
var content=tinyMCE.get('article').getContent();
警报(内容);
}
//满足于此
点击按钮获取编辑器的内容

<button onclick="get_content()">Get content</button> 
获取内容

请在此处发布您的解决方案。
tinyMCE.get('article').getContent()
不再有效,但user4389995使用
tinyMCE.activeEditor.getContent()的答案有效。谢谢。有没有办法从一个函数中获取同一页面上多个编辑器的内容?使用JS单击每个编辑器,然后获取活动编辑器似乎很愚蠢。
tinyMCE.activeEditor.getContent()