bootstrap 3 dynamic modal - ajax content caching issue

前端 未结 2 1332
轻奢々
轻奢々 2020-12-21 21:02

I need a dynamic bootstrap modal, depending on the id I sent to an exterior page in the same domain the result needs to come to me in a bootstrap modal. The system works whe

相关标签:
2条回答
  • 2020-12-21 21:18

    You can give the dynamic link to the modal, but before that clear the previous modal link every time when the modal is loaded with new link

    0 讨论(0)
  • 2020-12-21 21:33

    Use the following JavaScript to purge the cache every time the modal is displayed:

    $('#myModal').on('shown.bs.modal', function () {
        $(this).removeData('bs.modal');
    });
    

    It's also worth noting that remote modals are being deprecated in Bootstrap v3.2.1 and will be removed entirely in Bootstrap v4.

    0 讨论(0)
提交回复
热议问题