title: bootstrap tab, how to set selected tab on page load?
body: <p>Hello I'm having some trouble trying to save the current selected tab when the page is reloaded,</p>
  
  <p>I have a bootstrap 3.0 nav nav-tabs setup as my markup, like this:</p>
  
  <pre><code>&lt;ul class="nav nav-tabs" id="feedtab"&gt;
      &lt;li class="active" id="atlasstab"&gt;&lt;a href="#atlass" onclick="swapfeeds(1);" data-toggle="tab"&gt;Atlass&lt;/a&gt;&lt;/li&gt;
      &lt;li id="aviationtab"&gt;&lt;a onclick="swapfeeds(2);" href="#avi" data-toggle="tab"&gt;Aviation&lt;/a&gt;&lt;/li&gt;
      &lt;li id="ittab"&gt;&lt;a onclick="swapfeeds(3);" href="#proc" data-toggle="tab"&gt;IT&amp;S&lt;/a&gt;&lt;/li&gt;
      &lt;li id="processingtab"&gt;&lt;a onclick="swapfeeds(4);" href="#it" data-toggle="tab"&gt;Plan&amp;Proc&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I am storing the lastactive variable into a cookie, the values are correct so it seems my jquery is incorrect, I'm simply trying to set the active tab to the corresponding 'lastactive' variable, IE : 1, 2, 3, 4</p>
  
  <p>I'm aware that tab index starts at zero so i tried to increment the value +!, but still not working,  can someone point out my problem?</p>
  
  <p>this is the javascript im using to try set the active tab:</p>
  
  <pre><code>var lastactive = $.cookie("lastactive") != undefined ?  $.cookie("lastactive") : 1;
  
  $(document).ready(function() {
      $("#feedtab").tabs({active: lastactive + 1 });
  });
  </code></pre>