繁体   English   中英

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

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

我在Web浏览器控件上使用NiceEdtor。 在jQuery ready()函数我试图设置它的内容,结果我得到以下错误:

Object doesn't support property or method 'setContent'

以下是我给出的代码:

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

文本区域定义如下:

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

您需要使用nicEditors.allTextAreas();将textarea实例化为niceEditor控件nicEditors.allTextAreas(); 或者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>");
}); 

演示

文档

暂无
暂无

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

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