我們在使用js動態(tài)打開modal框使用remote請求數(shù)據(jù),只會加載一次數(shù)據(jù),所以我們需要在每次打開modal框錢移除節(jié)點(diǎn)數(shù)據(jù)。
解決方案:
$("#myModal").on("hidden.bs.modal", function() {
debugger;
$(this).removeData("bs.modal");
$(".modal-content").children().remove();
});