Because of the '?' tab library detect a GET method, and looks like it
prevents that.

I tried

<ul>class="nav nav-tabs">
  <li class="active"><a href="#day">Hot</a></li>
  <li><a href="#week">Week</a></li>
  <li><a href="#month">Month</a></li>

then,

$(function () {
  $('.nav-tabs a[href="#tab=month"]').tab('show');
});

and it works.

Hope it's enough for you.

Fabien



On Mon, May 21, 2012 at 4:30 PM, Ting-Yu Chou <[email protected]> wrote:

> Hello,
>
> I am trying to active a tab dynamically from js:
>
>   <ul>class="nav nav-tabs">
>   <li class="active"><a href="?tab=day">Hot</a></li>
>   <li><a href="?tab=week">Week</a></li>
>   <li><a href="?tab=month">Month</a></li>
>
>   <script>
>     $(function () {
>       $('.nav-tabs a[href="?tab=month"]').tab('show');
>     });
>   </script>
>
> But I still have tab "Hot" active, any ideas?
>
> # I created a fiddle <http://jsfiddle.net/v4wNa/>.
>
> Thank you
>

Reply via email to