當我點擊「工具」選項卡,發生什麼發生:標籤不切換,而不是切換。看起來你的文章主要是代碼;請添加更多的細節。引導AJAX選項卡不工作
$('[data-toggle="tab"]').click(function(e) {
\t var $this = $(this),
\t \t loadurl = $this.attr('href');
\t $.get(loadurl, function(data) {
\t \t $('#content').html(data);
\t });
\t $this.tab('show');
\t 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>
我按照這個教程來做:http://jsfiddle.net/adrienne/La2765jn/ – bars96 2015-04-03 16:52:20