<td width="8%" align="center" class=button2 onMouseDown="this.className='button3'" onMouseUp="this.className='button1'" onMouseOver="this.className='button1'" onMouseOut="this.className='button2'" style="height: 19px"><a href="../ui/Home/WorkTable.aspx" target="content">主页</a></td>
我想根据下面的JS获得的权限来控制href连接到不同的页面,怎么做啊??望指教??function changebyrole()
{
var txtrole=document.getElementById("PDMenu_lblCurRole");
if(txtrole==null)
{
document.frames['content'].document.location.href="./Home/WorkTable.aspx";
}
else
{
switch(txtrole.innerText)
{
case "支队领导":
document.frames['content'].document.location.href="./detachment/ZDLeader.aspx";
break;
default:
document.frames['content'].document.location.href="./Home/WorkTable.aspx";
break;
}
}
}
我想根据下面的JS获得的权限来控制href连接到不同的页面,怎么做啊??望指教??function changebyrole()
{
var txtrole=document.getElementById("PDMenu_lblCurRole");
if(txtrole==null)
{
document.frames['content'].document.location.href="./Home/WorkTable.aspx";
}
else
{
switch(txtrole.innerText)
{
case "支队领导":
document.frames['content'].document.location.href="./detachment/ZDLeader.aspx";
break;
default:
document.frames['content'].document.location.href="./Home/WorkTable.aspx";
break;
}
}
}
过啊,不行的,页面始终是这个WorkTable.aspx页面啊??
<a href=# target="content" onclick='javascript:changebyrole()'>
试试