使用Java Script获取TinyMCE编辑器文本 [英] get TinyMCE editor text using Java Script

查看:174
本文介绍了使用Java Script获取TinyMCE编辑器文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在项目中使用TinyMCE编辑器。我想编辑使用Javascript值。

我在谷歌上搜索过并得到以下代码:



tinyMCE.activeEditor.getContent ()



tinyMCE.get('editor1')。getContent();






但在使用此代码时我收到错误



JavaScript运行时错误:无法获取属性'getContent'未定义或空引用



aslo我试过



$(#PrevBCC) .text($(#<%= Editor1.ClientID%>)。val())



显示Span(PrevBCC)值但值是空白

Hi,

I am using TinyMCE editor in my project. I want to Editors value using Javascript.
I have searched on google and got below code:

tinyMCE.activeEditor.getContent()

tinyMCE.get('editor1').getContent();



but while using this code I am getting error as

JavaScript runtime error: Unable to get property 'getContent' of undefined or null reference

aslo I tried

$("#PrevBCC").text($("#<%= Editor1.ClientID %>").val())

to display value in Span (PrevBCC) but value is blank

推荐答案

(#PrevBCC)。text(
("#PrevBCC").text(


(#<%= Editor1.ClientID% >)。val())



在Span(PrevBCC)中显示值但值为空
("#<%= Editor1.ClientID %>").val())

to display value in Span (PrevBCC) but value is blank


它只是意味着您没有活动编辑器,也没有名为editor1的编辑器。你可能没有实例化任何。当您尝试使用未定义的对象(例如,从未初始化的变量)或null时,会显示此错误消息。



这是所有人都可以看到的信息。如果您还需要更多,则需要创建并显示一些自洽的代码示例。



-SA
It simply means that you don't have an active editor, and no editor named "editor1". You probably did not instantiate any. This error message is the usual message shown when you try to use undefined object (never initialized variable, for example), or null.

That's all one can see from your information. If you need some more, you would have to create and show some self-consistent code sample.

—SA


这篇关于使用Java Script获取TinyMCE编辑器文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆