Javascript 使用远程内容时是否有引导模式加载(或类似)功能?

Javascript 使用远程内容时是否有引导模式加载(或类似)功能?,javascript,jquery,twitter-bootstrap,modal-dialog,Javascript,Jquery,Twitter Bootstrap,Modal Dialog,引导有一个带有远程选项的模态方法。我想对Jquery/Bootstrap加载的内容执行一些操作。e、 例如,扫描特定类并动态替换内容 模态方法中是否有“onload”选项 $('#someplaceholder'.modal({ remote: "data/whatever/123", onloaded: function() { // perform some substitution,... }, }); 我现在通过使用setTimeout函数来解决

引导有一个带有远程选项的模态方法。我想对Jquery/Bootstrap加载的内容执行一些操作。e、 例如,扫描特定类并动态替换内容

模态方法中是否有“onload”选项

$('#someplaceholder'.modal({
    remote: "data/whatever/123",
    onloaded: function() {
    // perform some substitution,...
        },
});
我现在通过使用setTimeout函数来解决这个问题;但这不是一种优雅的方式

没有加载的事件,而且引导程序似乎没有对此提供修复。您可以执行以下操作

$('#someplaceholder').modal().find('.modal-body').load("data/whatever/123", function (data) {
    //do stuff with returned data here
});

如果你有20个模态,祝你好运:我确信引导程序的人没有实现一个加载的事件,因为它是多余的。jQuery中已经有nessecary基础设施,如果需要该功能,可以添加2或3行代码。比调整整个模态初始化更好。