如何把点击一个连接增加新的TAB选项卡改成只在一个TAB选...
function addTab(title, href,icon){var tt = $('#tt');
if (tt.tabs('exists', title)){//如果tab已经存在,则选中并刷新该tab
tt.tabs('select', title);
refreshTab({tabTitle:title,url:href});
} else {
if (href){
var content = '<iframe scrolling="no" frameborder="0"
src="'+href+'" style="width:100%;height:100%;"></iframe>';
} else {
var content = '未实现';
}
tt.tabs('add',{
title:title,
closable:true,
content:content,
iconCls:icon||'icon-default'
});
}
}
function refreshTab(cfg){
var refresh_tab = cfg.tabTitle?$('#tt').tabs
('getTab',cfg.tabTitle):$('#tt').tabs('getSelected');
if(refresh_tab && refresh_tab.find('iframe').length > 0){
var _refresh_ifram = refresh_tab.find('iframe');
var refresh_url = cfg.url?cfg.url:_refresh_ifram.src;
//_refresh_ifram.src = refresh_url;
_refresh_ifram.contentWindow.location.href=refresh_url;
}
}
页:
[1]