jQuery引导在Firefox中工作,但在IE中不起作用

jQuery引导在Firefox中工作,但在IE中不起作用,jquery,twitter-bootstrap,internet-explorer,firefox,Jquery,Twitter Bootstrap,Internet Explorer,Firefox,为什么jQuery和Bootstrap可以在Firefox中工作,但当我在IE中打开同一个页面时,什么都不起作用???呃,有人能解释一下发生这种情况时你必须做什么吗?您必须为每个浏览器编写单独的代码吗?我甚至不知道从哪里开始它如何在一个浏览器中工作,而在另一个浏览器中却不工作 此示例适用于firefox,但不适用于IE <select name="SPECIAL" id="SPECIAL"> <option>Please Select</option>

为什么jQuery和Bootstrap可以在Firefox中工作,但当我在IE中打开同一个页面时,什么都不起作用???呃,有人能解释一下发生这种情况时你必须做什么吗?您必须为每个浏览器编写单独的代码吗?我甚至不知道从哪里开始它如何在一个浏览器中工作,而在另一个浏览器中却不工作

此示例适用于firefox,但不适用于IE

<select name="SPECIAL" id="SPECIAL">
  <option>Please Select</option>
    <option data-name="Animal Friend" data-img="/images/img/AnimalFriend.png" data-price="$30" value="1">Animal Friend</option>
    <option data-name="Aquaculture" data-img="/images/img/Aquaculture.png" data-price="$30" value="2">Aquaculture</option>
    <option data-name="Protect Our Oceans" data-img="/images/img/ProtectOurOceans.png" data-price="$30" value="3">Protect Our Oceans</option>
    <option data-name="Conserve Wildlife" data-img="/images/img/ConserveWildlife.png" data-price="$30" value="4">Conserve Wildlife</option>
</select>
<!-- Modal -->
<div class="modal fade" id="modal_special" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">Specialty Plate</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
          <button type="button" class="btn btn-primary accept">Accept</button>
      </div>
    </div>
  </div>
</div>

$(function() {
        $('#SPECIAL').on('change', function() {
            if ($('option:selected', this).is('[data-img]')) {
                $('#modal_special').find('.modal-body').html('<p>Image will go here:</p>')
                .append('<img alt="coming soon" src="' + $('option:selected', this).data('img') + '"/>')
                .end().modal('show');
            }
        });
        $('.accept').on('click',function() {
            //do something
            $('#modal_special').modal('hide');
        });
    });

没有Bootstrap或IE版本,这是一个有点悬而未决的问题

尽管值得注意的是,最新的引导构建不支持IE7及以下版本。此外,如果您希望支持IE8/9,则需要添加其他库,如Respond.js

Boostrap文档中有一个完整的部分介绍了浏览器支持以及为使一切顺利运行所需采取的措施


考虑到你在问题中提供的一点信息,最明显的行为来源是IE 8或更低版本的过时版本。请参见中的浏览器支持


如果是这样的话,试着在你的网站中加入。如果这不能解决问题,我强烈建议您在问题中提供更多信息。

您需要发布哪个版本的引导和IE?您需要发布代码。我们无法读懂你的心思。请尝试使用。你确定你在边缘模式而不是怪癖模式下运行IE吗?@Bauer你的标记无效。我的意思是,请认真选择?这是否修复了jQuery 2.1和bootstrap 3.2?我需要的只是添加一个响应?我只是在firefox中使用了很多jQuery函数,甚至在IE10中都不存在。我认为我不应该显示所有函数。从jQuery 1.9.0及更高版本开始,Bootstrap就可以工作。jQuery 2.1不支持IE8,而1.9支持IE8。IE10在任何jQuery和Bootstrap版本中都应该是不错的。您是否有收到的特定错误?我们建议您始终使用与x-UA兼容的标记或HTTP头。Bootstrap演示是jQuery和X-UA的1.11版。。。Stuff我认为这可能是问题所在Christinai在这种情况下,请提供一个示例,例如使用Stackoverflow、JSFIDLE或bootply