javascript - 未呈现 JQuery UI 对话框模态标题 html 标签

标签 javascript html css jquery-ui-dialog

我目前正在为我的应用程序添加模态。显示模态时,它还会在模态标题内显示 html 标签。 screen

如您所见,对话框标题未呈现,它显示 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>&nbsp; Delete all items",
            "class" : "btn btn-danger",
            click : function() {
              $(this).dialog("close");
            }
          }, {
            html : "<i class='fa fa-times'></i>&nbsp; Cancel",
            "class" : "btn btn-default",
            click : function() {
              $(this).dialog("close");
            }
          }]
        });

        })

我错过了什么吗?提前致谢

最佳答案

看起来这与 Bootstrap 无关。 据我所知,您正在使用 jQuery UI 对话框 ( http://jqueryui.com/dialog/ ),对吗?

title 属性只接受一个字符串,但您可以覆盖默认行为,如下所示:https://stackoverflow.com/a/14488776/3215856

关于javascript - 未呈现 JQuery UI 对话框模态标题 html 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47661387/

相关文章:

javascript - 错误的偏移量();在 Firefox 上

javascript - 单击通知时切换到发送通知的选项卡?

javascript - FullPage.js - slider 每次自动滚动到顶部

jquery - 下拉立即打开

如果 css 无法处理图像,jQuery 回退

javascript - 在 Chrome 上运行可执行应用程序?

javascript - 日出闹钟 - 网站

javascript - 我怎样才能在 Canvas 上看到整个图片的原始分辨率,而不会降低质量?

css - Flexbox 走出容器

javascript - 我如何通过循环获取元素,html?