尝试获取内容时出现timece错误
tinyMCE error whe trying to get content
我得到这个错误:Uncaught TypeError: Cannot read property 'getContent' of undefined
if (tinymce.editors.length > 0) {
alert('editor exist')
var myEditor = tinyMCE.get['rteCaseHeading'].getContent();
$("#bookId").html(myEditor);
}
在Html中:
<textarea class="mceEditor" id="rteCaseHeading" rows="10" cols="100" style="height: 300px"> </textarea>
我还在tinyMCE init期间指定了:editor_selector : "mceEditor",
。
我已经参考了关于这个错误的各种链接/问题并实现了
尽管编辑器的长度大于0,但仍会抛出错误。
有人,请建议我在这个问题上挣扎了2-3个小时以上。(更新)
我引用了这个链接并添加了以下代码:http://jsfiddle.net/9euk9/49/
ed.on('change', function () {
ed.save();
});
仍然没有运气。非常感谢!
将<textarea>
包含在<form></form>
标签中。
检查下面的代码,