简体   繁体   中英

Bootstrap Tabs Not Working throwing tab undefined error

I am using the below code to render the bootstrap tab in my MVC application. All the scripts are loaded correctly. but still throwing tab undefined error.

<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/bootstrap-tabs.js")" type="text/javascript"></script>

<ul id="myTab" class="nav nav-tabs">
    <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
    <li><a href="#profile" data-toggle="tab">Profile</a></li>
</ul>
<div id="myTabContent" class="tab-content">
    <div class="tab-pane fade in active" id="home">
        jhgh
    </div>
    <div class="tab-pane fade" id="profile">
        mbjb
    </div>

</div>


<script type="text/javascript">
    $(function () {

        $('#myTab a').click(function (e) {debugger
            e.preventDefault()
            $(this).tab('show');
        });
    });

</script>

Thanks,

Siva

Try to remove "debbuger" WORKING FIDDLE

HTML

<ul id="myTab" class="nav nav-tabs">
  <li class="active">
      <a href="#home" data-toggle="tab">Home</a>
  </li>
  <li>
      <a href="#profile" data-toggle="tab">Profile</a>
  </li>
</ul>
<div id="myTabContent" class="tab-content">
  <div class="tab-pane fade in active" id="home">
      jhgh
  </div>
  <div class="tab-pane fade" id="profile">
      mbjb
  </div>
</div>

JAVASCRIPT

   $(function () {
        $('#myTab a').click(function (e) {
            e.preventDefault()
            $(this).tab('show');
        });
    });

您应该导入完整的引导程序的javascript库,似乎存在对引导程序文件js的javascript依赖

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM