当我点击"工具"选项卡,无:标签不会切换,不会切换。
$('[data-toggle="tab"]').click(function(e) {
var $this = $(this),
loadurl = $this.attr('href');
$.get(loadurl, function(data) {
$('#content').html(data);
});
$this.tab('show');
return false;
});

<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<ul class="nav nav-tabs nav-justified" role="tablist">
<li role="navigation" class="active"><a href="/engine/ajax/main.php" aria-controls="main" role="tab" data-toggle="tab">My links</a></li>
<li role="navigation"><a href="#tools" aria-controls="stat" role="tab" data-toggle="tab">Statistics</a></li>
<li role="navigation"><a href="/engine/ajax/tools.php" aria-controls="tools" role="tab" data-toggle="tab">Tools</a></li>
<li role="navigation"><a href="#payments" aria-controls="payments" role="tab" data-toggle="tab">Payments</a></li>
</ul>
</div>
<div id="content" class="container">
</div>
&#13;
我哪里错了?
答案 0 :(得分:0)
放
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
之前
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
bootstrap.min.js要求jquery.min.js在它之前先运行。