且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在模态中重新加载内容(twitter bootstrap)

更新时间:2022-12-16 13:14:25

我遇到了同样的问题,我想这样做的方法会是删除data-toggle属性并为链接设置自定义处理程序。

I am having the same problem, and I guess the way of doing this will be to remove the data-toggle attribute and have a custom handler for the links.

以下行中的内容:

$("a[data-target=#myModal]").click(function(ev) {
    ev.preventDefault();
    var target = $(this).attr("href");

    // load the url and show modal on success
    $("#myModal .modal-body").load(target, function() { 
         $("#myModal").modal("show"); 
    });
});

稍后会尝试并发表评论。

Will try it later and post comments.