<div class="admin">
<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-bkgl'"
data-icon="icon-ok" data-link="test/admin-index" style="width: 150px;" iframe="0">管理员登录</a>
</div>
$(function() {
$('.admin a').bind("click", function() {
/* alert("hello"); */
var title = $(this).text();
var url = $(this).attr('data-link');
var iconCls = $(this).attr('data-icon');
var iframe = $(this).attr('iframe') == 1 ? true : false;
/* alert(iframe); */
alert(url);
admin_index(title, url, iconCls, iframe);
});
});
function admin_index(title, href, iconCls, iframe){
var tabPanel = $('#tabs');
if(!tabPanel.tabs('exists',title)){
var content = '<iframe scrolling="auto" frameborder="0" src="'+ href +'" style="width:100%;height:100%;"></iframe>';
if(iframe){ /* inframe为true 页面内跳转 */
/* alert("iframe=true"); */
tabPanel.tabs('add',{
title:title,
content:content,
iconCls:iconCls,
fit:true,
cls:'pd3',
closable:true
});
}
else{/* inframe为false执行 页面外部跳转*/
alert("iframe=false");
$(location).attr('href',href);
/*tabPanel.tabs('add',{
title:title,
href:href,
iconCls:iconCls,
fit:true,
cls:'pd3',
closable:true
}); */
}
}
else
{
alert("iframe=3");
tabPanel.tabs('select',title);
}
}
通过iframe控制页面内部还是外部跳转在标签内部设置iframe