Bootstrap警告框无法关闭

4
我遇到了关闭bootstrap警告框的问题。我在引入bootstrap之前已经声明了jquery,但警告框仍然无法关闭。以下是警告框的代码。有什么建议吗?
  <!-- jquery -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

  <!-- bootstrap -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">


  <div class="alert alert-success alert-dismissible" role="alert">
     <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
     <strong>Yay</strong> Your email has been added!
  </div>

请查看此答案 http://stackoverflow.com/questions/30969850/bootstrap-dropdown-menu-does-not-work/30971313#30971313。 - Yandy_Viera
1个回答

8

您仍需添加Twitter Bootstrap核心JS。

<!-- jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>

<!-- bootstrap -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">


<div class="alert alert-success alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span>
  </button>
  <strong>Yay</strong> Your email has been added!
</div>


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接