Javascript jquery对话框中的所见即所得编辑器不工作
网站的编辑。我测试了一些(tinyEditor、wysihtml5、jHTMLArea…)。当我的网站上只有一个textarea元素时,它就可以工作了。但是,当我创建jQuery对话框并想将编辑器放入其中时,它就不起作用了。我看到了所有的图标和按钮,但我无法将文本写入编辑器。问题总是一样的。我使用的是jQuery1.10.2。 有没有人遇到过同样的问题或者有没有解决办法 (我用chrome和firefox测试了我的网站) 以下是一些代码(jHtmlArea): HTML代码:Javascript jquery对话框中的所见即所得编辑器不工作,javascript,jquery,wysiwyg,jhtmlarea,Javascript,Jquery,Wysiwyg,Jhtmlarea,网站的编辑。我测试了一些(tinyEditor、wysihtml5、jHTMLArea…)。当我的网站上只有一个textarea元素时,它就可以工作了。但是,当我创建jQuery对话框并想将编辑器放入其中时,它就不起作用了。我看到了所有的图标和按钮,但我无法将文本写入编辑器。问题总是一样的。我使用的是jQuery1.10.2。 有没有人遇到过同样的问题或者有没有解决办法 (我用chrome和firefox测试了我的网站) 以下是一些代码(jHtmlArea): HTML代码: <!-- D
<!-- Dialog Beginn -->
<div id="dialog" title="Studie" >
<center>
<textarea id="dialogEditor" rows="10" style="width: 400px"></textarea>
</center>
</div>
<!-- Dialog End -->
文本区域显示后,只需实例化编辑器。 在代码中,您是在
对话框
打开之前对其进行实例化的。评论出来,让它工作
function openDialog() {
//$('#dialogEditor').htmlarea(); <-- Comment out this
//$.ui.dialog.defaults.bgiframe = true;
$(function () {
$("#dialog").dialog({
width: 420,
autoOpen: false,
open: function (evt, ui) {
$("#dialogEditor").htmlarea();
}
});
});
$('#dialog').dialog('open');
}
函数openDialog(){
//$('#dialogEditor').htmlarea();请显示您的HTML/CSS,甚至可能显示您的问题的JSFIDLE.net。啊,这帮助我解决了这个问题!谢谢!
function openDialog() {
//$('#dialogEditor').htmlarea(); <-- Comment out this
//$.ui.dialog.defaults.bgiframe = true;
$(function () {
$("#dialog").dialog({
width: 420,
autoOpen: false,
open: function (evt, ui) {
$("#dialogEditor").htmlarea();
}
});
});
$('#dialog').dialog('open');
}