0

先看代码。

html按钮:

    <a href="/ajax/addrecord.php" class="btn" data-toggle="modal">Add Record</a>

事件:

    $('[data-toggle="modal"]').click(function(e) {
    $('.modal').remove(); //to remove modals if already open
    e.preventDefault();     
        $.ajax({
          url: $(this).attr('href'),              
          cache: false,
          success: function(data) {$('<div class="modal hide fade" style="width:850px;">' + data + '</div>').modal()}});
});

在 IE8 中,当我单击按钮时,它会加载背景,再次加载近 15 次,但不显示模式。我在 bootstrap-modal-js 的“背景”功能中放置了一条日志消息,对于 IE8,它提供了超过 10 条消息,而在其他浏览器中,日志仅显示 1 条消息。

任何人都可以提示这个问题吗?

4

1 回答 1

0

href我遇到了同样的问题,并通过使用or的完整路径来修复它data-remote<a href="http://example.com/ajax/addrecord.php" ...>

于 2013-08-02T19:50:06.350 回答