I am using twitter bootstrap in my work. The "tab" method
(ie; $("a element under tab li").tab("show") ) swiches to the new tab specified by the jQuery selector perfectly, until an ajax loading is done. When I create a new tab using jQuery append, load its pane content by jQuery load and try to switch to that new tab using tab("show") it gives error element doesnt have a method tab
UPDATE
<div class="tabbable">
<ul class="nav nav-tabs" id="tab-set">
<li class="active"><a data-toggle="tab" href="#tab1"> tab 1</a></li>
<li><a data-toggle="tab" href="#tab2">tab 2</a></li>
<li><a data-toggle="tab" href="#tab3">tab 3</a></li>
<li><a data-toggle="tab" class="ajax" href="test.html">tab 4 - ajax</a></li>
</ul>
<div class="tab-content" id="tab-content">
<div id="tab1" class="tab-pane active"> tab 1 content </div>
<div id="tab2" class="tab-pane"> tab 2 content </div>
<div id="tab3" class="tab-pane"> tab 3 content </div>
</div>
</div>
This is the javascript code to add new tab via ajax
$("#tab-set").append("<li id='"+tabType+"'><a href='#" + tabType +
"-pane' data-toggle=\"tab\"> " + tabName + "</a></li>");
$("#tab-content").append("<div class=\"tab-pane\" id=\"" +tabType + "-pane\"></div>");
$("#" + tabType + "-pane").load(tabUrl);
After adding new tab i try to switched to that tab using
$("#" + tabType + " a").last().tab("show");
but that doesn't work.