Send parameter to Bootstrap modal window?

前端 未结 4 1850
北荒
北荒 2020-12-13 04:39

I have a problem, I cannot pass any parameters to a modal window (using Bootstrap 3), I tried using the solution stated in this link, but I cannot make it work:

Dyna

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 05:33

    I have found this better way , no need to remove data , just call the source of the remote content each time

    $(document).ready(function() {
        $('.class').click(function() {
            var id = this.id;
            //alert(id);checking that have correct id
            $("#iframe").attr("src","url?id=" + id);
            $('#Modal').modal({ 
                show: true 
            });
        });
    });
    

提交回复
热议问题