jquery – how to Make Specific Tab "active" when going from different link in Bootstrap 3.0-ThrowExceptions

Exception or error:

I have a problem in loading specific tab as active when going from different link. What i want to do actually is, place a content using Bootstrap Tab and i want them to use as menu, so whenever i click the menu from the same page or even from a different page, i want it to go to specific page and make the specific tab “active”

How is this possible, i tried lot of resources in bootstrap and its not working.

<table class="nav-tabs" cellspacing="0">
          <td><a class="active" href="#payment_tab" data-toggle="tab">Payment Services</a></td>
          <td><a href="#pci_tab" data-toggle="tab">PCI Compliance - Link</a></td>
          <td><a href="#marketing_tab" data-toggle="tab">Marketing</a></td>
          <td><a href="#support_tab" data-toggle="tab">Support & Service</a></td>

ANd the link i am trying to do is http://www.anjan.com.np/boom/merchants.html

Thank you in advance

New changes made:

<table class="nav nav-tabs">
  <td><a href="#home" data-toggle="tab" class="active">Home</a></td>
  <td><a href="#profile" class="profile-link" data-toggle="tab">Profile</a></td>
  <td><a href="#messages" class="next-link" data-toggle="tab">Messages</a></td>
<div class="tab-content">
  <div class="tab-pane active" id="home">Home Content</div>
  <div class="tab-pane" id="profile">Profile Content</div>
  <div class="tab-pane" id="messages">Messages Content</div>

Profile Link From Outside

$(".outside-link").click(function() {
    $(".nav-tabs tr td a").removeClass("active");

$(".next-link").click(function() {
    $(".nav-tabs tr td a").removeClass("active");

can anyone help me to simplify this jQuery with generalization???

How to solve:

/** Jquery Code on load **/



html menu :

<aside id="dx-sidebar">
        <li><a href="http://localhost/cms-dboxmint/app/reading"><i class="i i-desktop"></i>dashboard</a></li>
        <li><a href="http://localhost/cms-dboxmint/app/reading2"><i class="i i-list-alt"></i>GUI app</a></li>
        <li><a href=""><i class="i i-file-text"></i>posts</a></li>
        <li><a href=""><i class="i i-archive"></i>archive</a></li>
        <li><a href=""><i class="i i-book"></i>wiki</a></li>
        <li><a href=""><i class="i i-comments-o"></i>ngobrol</a></li>
        <li><a href=""><i class="i i-cogs"></i>setting</a></li>
</aside><!--END SIDEBAR-->

css style, (in bootstrap you can replace with active ), for xample yuo can visit here http://getbootstrap.com/examples/navbar/ :

  color: red!important;

jquery script :

$(document).ready(function() {
    var currentPage = document.location.href.substr(0); //get current page url
    $("#dx-sidebar ul li a").each(function(num, val){
        if($(val).attr('href') == currentPage){

Leave a Reply

Your email address will not be published. Required fields are marked *