open tab in new window
open tab in new window
The UI.Tabs doc page ( http://docs.jquery.com/UI/Tabs ) indicates that
you can direct a tab click to open in a new window with the following
code:
$('#example').tabs({
select: function(ui) {
location.href = $.data(ui.tab, 'load.tabs');
return false;
}
});
I cannot seem to get this to work. If I stick an alert in there, the
$.data(ui.tab, 'load.tabs') call seems to always return undefined, as
if looking up ui.tab with the $.data function is failing. With
alert(ui.tab.href); you see the current value of the tab's href after
it is manipulated during load... it will be something like #ui-tabs-XX
where XX is a number. Why is the $.data() lookup failing? In order
for this to work, the original href is needed. The example would seem
to indicate that calling $.data(ui.tab, 'load.tabs') will get you the
original href, but that doesn't seem to be the case.