<div id="exampleModal"> 。。。</div> <button data-toggle="modal" data-target="#exampleModal"></button> $('#exampleModal').on('show.bs.modal', function(event) { $.ajax(...); $(this).modal('hide'); });
第一次打开窗口会有一次 ajax ,不刷新,第二次打开窗口会有两次 ajax 。是因为$('#exampleModal')重复捆绑 modal 。怎样才能在不刷新前提下多次打开窗口但只绑定一个 modal 。
![]() | 1 fising 2016-06-21 08:15:42 +08:00 via iPhone 每次都先 unbind ,应该有更好的办法 |
3 xx19941215 2017-03-12 18:42:24 +08:00 怎么弄的,我也遇到了类似的情况!!! |