Twitter引导程序导航选项卡与<! - ?php include? - >不起作用

时间:2014-11-25 08:15:35

标签: php html twitter-bootstrap tabs

我的标签导航有问题。我无法显示第二个和第三个标签。 这是代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example of Twitter Bootstrap 3 Dynamic Tabs</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
$("#myTab a").click(function(e){
    e.preventDefault();
    $(this).tab('show');
});
});
</script>
</head>
<body>
<div class="bs-example">
<ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="#add">Add Employee</a></li>
    <li><a href="#sch">Employee List</a></li>
    <li><a href="#list">Employee Schedule</a></li>
</ul>
<div class="tab-content">
    <div id="add" class="tab-pane active">
        <?php include('addempform.php');?>
    </div>
    <div id="sch" class="tab-pane">
        <?php include('addschform.php');?>
    </div>
    <div id="list" class="tab-pane">
       <?php include('emplist.php');?>
    </div>
    </div>
</div>
</body>
</html>    

我注意到错误是在?php include('xxx.php')?&gt;。我该如何解决这个问题?

感谢。

2 个答案:

答案 0 :(得分:1)

您好,在选项卡面板中放置一些PHP代码,您必须在Iframe之间插入它 喜欢:

<iframesrc="xxx.php"></iframe>

答案 1 :(得分:0)

我刚刚纠正了你的代码,jQuery必须在引导之前加载!

问候

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example of Twitter Bootstrap 3 Dynamic Tabs</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
$("#myTab a").click(function(e){
    e.preventDefault();
    $(this).tab('show');
});
});
</script>
</head>
<body>
<div class="bs-example">
<ul class="nav nav-tabs" id="myTab">
    <li class="active"><a href="#add">Add Employee</a></li>
    <li><a href="#sch">Employee List</a></li>
    <li><a href="#list">Employee Schedule</a></li>
</ul>
<div class="tab-content">
    <div id="add" class="tab-pane active">
        <?php include('addempform.php');?>
    </div>
    <div id="sch" class="tab-pane">
        <?php include('addschform.php');?>
    </div>
    <div id="list" class="tab-pane">
       <?php include('emplist.php');?>
    </div>
    </div>
</div>
</body>
</html>