gpt4 book ai didi

javascript - tinyMCE 不添加特定文本区域的控件

转载 作者:行者123 更新时间:2023-11-30 18:20:59 26 4
gpt4 key购买 nike

我正在尝试添加一个文本区域并使用

动态激活它
tinyMCE.execCommand('mceAddControl', false,'id')

我已经在其他文本区域中尝试过,效果很好,但不适用于这个特定的文本区域:

'id_sguidepoint_set-'+index+'-gp_description'

会不会是名字太大了?还是因为某些字符在 tinyMCE 中无效?

这是我的 tinyMCE 初始配置:

tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "emotions,spellchecker,advhr,insertdatetime,preview,jbimages",

// Theme options - button# indicated the row# only
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect",
theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,jbimages,|,code,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "insertdate,inserttime,|,spellchecker,advhr,,removeformat,|,sub,sup,|,charmap,emotions",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : false ,
relative_urls : false
});

这是我要激活的元素:

<textarea id="id_sguidepoint_set-3-gp_description" rows="10" cols="40" name="sguidepoint_set-3-gp_description" style="display: none; " aria-hidden="true"></textarea>

显然有不止一个文本区域,这就是为什么我必须使用索引来遍历它们

任何帮助将不胜感激

提前致谢

最佳答案

好的,在尝试了很多不同的事情之后我发现我的问题是文本区域被隐藏了:

style= "display: none"

这就是问题所在,因为可以绘制文本区域,所以一切正常。

希望对遇到同样问题的其他人有所帮助。

问候

关于javascript - tinyMCE 不添加特定文本区域的控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12039875/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com