在 BootStrap 模式对话框中包含 HTML 代码

Include HTML code in BootStrap Modal Dialog

我想使用 Boot Strap Modal(http://nakupanda.github.io/bootstrap3-dialog/),我在 HTML 和 [=23] 中包含了 Bootstrap 模态脚本和 Css =] 对话框工作正常。现在我的问题是如何在模式对话框中包含我的 html 代码。 在示例(http://nakupanda.github.io/bootstrap3-dialog/)中,它显示在模态的 "message" 属性 中包含 HTML 代码。但是我想在模式中使用我现有的HTML而不重写JS文件中的html代码。

您可以将标记保存在模板文件中,并且

BootstrapDialog.show({
    message: $('<div></div>').load('template.html')
});

或重用一些已经存在的 HTML

BootstrapDialog.show({
    message: $('#element').html()
});