I have a set of tabs where the href is the URL I would like to load when the tab is selected.
Following the docs I added the following select option.
$('#example').tabs({
select: function(event, ui) {
var url = $.data(ui.tab, 'load.tabs');
if( url ) {
location.href = url;
return false;
}
return true;
}
});
in a <script>
tag in the top of each page (ASP.NET master page).
The page loads, but the tab is never selected visually, i.e., the first tab is always selected even though say tab #3 content is displayed.
In tracing the script above in FireBug, once the location.href=url
is executed the new page loads and the return statements are never executed. Is this a problem?
Thanks
ADDITIONAL INFO Just wanted to clarify that I am not trying to load the content for a tab via Ajax, but need to do a postback. In conjunction with the postback I want to have the tab that was clicked become the selected tab. Also, the example above is from Section 3.6 on the jQueryUI/Tabs page.