【发布时间】:2017-12-06 07:33:15
【问题描述】:
我目前正在向我的应用程序添加模态。当模态显示时,它还会在模态标题中显示 html 标签。
如您所见,对话框标题未呈现,而是显示 html 标记。这里是对话框 html
<div id="dialog_simple" title="Dialog Simple Title">
<p>
Dialog part is woring just fine.
</p>
</div>
这里有相关的javascript来打开模态
$('#dialog_link').click(function() {
$('#dialog_simple').dialog('open');
return false;
});
$('#dialog_simple').dialog({
autoOpen : false,
width : 600,
resizable : false,
modal : true,
title : "<div class='widget-header'><h4><i class='fa fa-warning'></i> Empty the recycle bin?</h4></div>",
buttons : [{
html : "<i class='fa fa-trash-o'></i> Delete all items",
"class" : "btn btn-danger",
click : function() {
$(this).dialog("close");
}
}, {
html : "<i class='fa fa-times'></i> Cancel",
"class" : "btn btn-default",
click : function() {
$(this).dialog("close");
}
}]
});
})
我错过了什么吗?在此先感谢
【问题讨论】:
-
看起来你正在用你自己的包装 Bootstrap 的 Modal 插件。确保
title没有将其视为纯文本而是 HTML。
标签: javascript html css jquery-ui-dialog