Bootstrap Modal Dynamic Content

后端 未结 3 1152
感动是毒
感动是毒 2021-02-04 09:31

I\'m in need of a method to load dynamic content that can change at any time. According to the Bootstrap documentation

3条回答
  •  盖世英雄少女心
    2021-02-04 10:05

    If your users can tolerate the delay, reload the content whenever the show event occurs.

    $('#modal').on('show.bs.modal', function(){
        $.get("remote.htm", function(data){
            $('#modal').find('.modal-content').html(data);
        })
    })
    

    Add error handling and parameters as needed

提交回复
热议问题