Javascript show.bs.modal不显示动态内容
我有一个对象数组,我想把它推到show.bs.js模式中。每个对象都有自己的按钮每个按钮都应该触发一个事件,将对象内部的信息相应地推送到模式中。 但是模态没有接收到信息。。我正在上传我的代码以获取建议 htmlJavascript show.bs.modal不显示动态内容,javascript,bootstrap-4,Javascript,Bootstrap 4,我有一个对象数组,我想把它推到show.bs.js模式中。每个对象都有自己的按钮每个按钮都应该触发一个事件,将对象内部的信息相应地推送到模式中。 但是模态没有接收到信息。。我正在上传我的代码以获取建议 html 情态标题 &时代; ... 接近 保存更改 情态标题 &时代; ... 接近 保存更改 我在html中看不到任何属性,如数据步骤或数据名称。这些值是如何设置的?请提供一个抱歉的消息,我忘了添加,我通过jQuery附加了按钮,jQuery附带了数据属性。现在包括。这里确实需要更多的调试
情态标题
&时代;
...
接近
保存更改
情态标题
&时代;
...
接近
保存更改
我在html中看不到任何属性,如数据步骤
或数据名称
。这些值是如何设置的?请提供一个抱歉的消息,我忘了添加,我通过jQuery附加了按钮,jQuery附带了数据属性。现在包括。这里确实需要更多的调试细节。根据上面的链接,一个可运行的演示演示演示了这个问题也会有帮助。下面的代码片段是我正在尝试使用show.bs.js.modal动态推送到modal中的对象数组。很抱歉给你带来了困惑。我对这个有点陌生。
<div class="modal" id="myModal" tabindex="0" data-toggle="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<div class="modal" id="myModal" tabindex="0" data-toggle="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>