Textarea编辑器Redactor.用jQuery插入值 [英] Textarea editor Redactor. Insert value with jQuery

查看:112
本文介绍了Textarea编辑器Redactor.用jQuery插入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有字段textarea id="tr" 使用HTML编辑器Redactor的最新版本 尝试准确设置字段的值,如API Doc中所述:

Have field textarea id="tr" using HTML editor Redactor last version trying to set value of the field exactly haw it is described in API Doc :

$('#tr').redactor('insertText', 'text'); 

$('#tr').redactor('insertHtml', 'text');

我在做什么错了?

推荐答案

尝试设置API ,我认为是insertText/insertHtml的较低版本.

Try the set API, which I think is a lower-level version of insertText/insertHtml.

因此在您的示例中,应该是:

So in your example, it should be:

$('#tr').redactor('set', 'Your text goes here');

更新:在修订版本10(及更高版本)中,设置方法的名称已更改,如

Update: In redactor version 10 (and greater), the name of the set method was changed, as documented here:

$('#tr').redactor('code.set', 'Your text goes here');

这篇关于Textarea编辑器Redactor.用jQuery插入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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