Twitter bootstrap remote modal shows same content every time

前端 未结 22 1375
春和景丽
春和景丽 2020-11-22 12:29

I am using Twitter bootstrap, I have specified a modal

<
22条回答
  •  无人共我
    2020-11-22 13:05

    In Bootstrap 3.2.0 the "on" event has to be on the document and you have to empty the modal :

    $(document).on("hidden.bs.modal", function (e) {
        $(e.target).removeData("bs.modal").find(".modal-content").empty();
    });
    

    In Bootstrap 3.1.0 the "on" event can be on the body :

    $('body').on('hidden.bs.modal', '.modal', function () {
        $(this).removeData('bs.modal');
    });
    

提交回复
热议问题