简体   繁体   English

无法在Web浏览器COntrol中设置NiceEditor内容

[英]Unable to set NiceEditor content in Web Browser COntrol

I am using NiceEdtor on Web Browser control. 我在Web浏览器控件上使用NiceEdtor。 on jQuery ready() function I am trying to set content of it and in result I get following error: 在jQuery ready()函数我试图设置它的内容,结果我得到以下错误:

Object doesn't support property or method 'setContent'

Below is my given Code: 以下是我给出的代码:

$(function () {
    var nicE = new nicEditors.findEditor('__edit');
    nicE.setContent("<b>Hi</b>");
}); 

Text area is defined as following: 文本区域定义如下:

<textarea name="question" rows="15" cols="130" id="__edit"></textarea>

You need to instantiate the textarea to niceEditor control using nicEditors.allTextAreas(); 您需要使用nicEditors.allTextAreas();将textarea实例化为niceEditor控件nicEditors.allTextAreas(); or new nicEditor().panelInstance('__edit'); 或者new nicEditor().panelInstance('__edit'); .

$(function () {

     //nicEditors.allTextAreas();  // Set globally for all textareas.
   new nicEditor().panelInstance('__edit'); // redister textarea to be a niceeditor

   ///... some code

    var nicE = new nicEditors.findEditor('__edit');
    nicE.setContent("<b>Hi</b>");
}); 

Demo 演示

Documentation 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM