我正在尝试将大量 HTML(大约 10k 行)附加到 Bootstrap 模式。
async function generatereport(){
$('#ProfilingReport').empty();
let BIGHTML = await GenerateBIGHTML();
$("#ProfilingReport").append(BIGHTML);
}
和 html
<div class="modal-body" id="#ProfilingReport">
</div>
但是,函数运行完毕后,模态框仍然为空。 有没有办法将大量 html 附加到模式或窗口?
最佳答案
#
selector is used when call the data from div or to pass data into div in jQuery
您需要从 div 的 id="#ProfilingReport"
中删除 #
符号
<div class="modal-body" id="ProfilingReport">
</div>
关于javascript - 将大 html 文件附加到模态窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57205555/