Jquery 关闭时无法从模式中删除视频数据。每次都显示相同的内容
关闭时无法从模式中删除视频数据。每次都显示相同的内容Jquery 关闭时无法从模式中删除视频数据。每次都显示相同的内容,jquery,twitter-bootstrap,Jquery,Twitter Bootstrap,关闭时无法从模式中删除视频数据。每次都显示相同的内容 $('body').on('hidden.bs.modal', '.modal', function () { $(this).removeData('bs.modal'); }); 此函数也不起作用。在我将数据传递到同一模式并删除内容时,遇到了相同的问题。最好的解决方案是使用bootBox 以这种方式尝试Bootstrap v3.2.0 $(document).on("hidden.bs.modal", function (e) {
$('body').on('hidden.bs.modal', '.modal', function () {
$(this).removeData('bs.modal');
});
此函数也不起作用。在我将数据传递到同一模式并删除内容时,遇到了相同的问题。最好的解决方案是使用bootBox
以这种方式尝试Bootstrap v3.2.0
$(document).on("hidden.bs.modal", function (e) {
$(e.target).removeData("bs.modal").find(".modal-content").empty();
});
通用模态的例子
<div class="modal hide" id="">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
</div>
</div>
男人们,我终于可以让ir工作了 应该是
$('body').on('hide.bs.modal', '.modal', function (e) {
$(this).find('form').trigger("reset");
});
在这篇文章中,Sadikhasan用户指出,您需要清除表单数据,但$this是modal div,因此,您需要在模式中找到表单并将其重置。是否有任何方法可以在每次重新启动模式时清除其缓存。您使用的是哪个版本的引导?我不能在这里使用引导框。有几种下拉列表和输入类型。请检查我的html,我完全不清楚上面脚本中的div id。@shakun您的代码是完全遥不可及。请输入相关代码并加载外部库。您可以给出上述脚本使用的任何示例。主id不工作。现在我正在使用此$'.md close'。单击函数{window.location.reload};
$('body').on('hide.bs.modal', '.modal', function (e) {
$(this).find('form').trigger("reset");
});