将值设置为nicedit - 使用textarea作为实例

chi*_*nvh 5 jquery nicedit

这是链接,您的webbrowser将导航到:http://thocong.net/dang-tin.html


我正在开发一个应用程序,它将自动发布新闻.将值设置为网页上的控件时,所有控件都可以,但我无法将值设置为编辑器(NicEdit).该编辑器使用TextArea标签作为实例.我已将值设置为textarea,但是当发布新闻时,我找不到设置为此textarea的内容.所以,请帮助我解决这个问题.

以下是我用来设置网页控件值的代码(上面的链接)

HtmlDocument document = webBrowser.Document;
HtmlElement description = document.GetElementById("content");//id of textarea
description .SetAttribute("value", info.Content);
Run Code Online (Sandbox Code Playgroud)

- >>摘要:请告诉我如何将值设置为漂亮的编辑器?

anu*_*ava 11

我知道这是一个非常古老的问题,但如果你还没有找到答案,那就是:

nicEditors.findEditor( "your-textarea-id" ).setContent( 'some value' );
Run Code Online (Sandbox Code Playgroud)


小智 0

我想您会在这里找到您需要的内容:http://pastebin.com/sj8QA4xx - 它展示了如何使用 nicEditor 的 API 在当前光标位置插入文本。我成功地使用它以编程方式修改 nicEditor 的内容。祝你好运!