frameset其他地方刷新屏蔽,IE和火狐测试过

在使用frameset页面时,我们常常在选中左边的菜单的页面按F5键时,刷新的 左边的菜单页面,而不是中间页面,同理在顶部底部都一样的道理,所以需要在那些页面屏蔽下F5,并且让主页面刷新

 

 

document.onkeydown = function(e){
 var ev = e ? e :event;
 if(window.addEventListener){
  if(ev.keyCode==116){
   parent.frames['mainframe'].location.reload();
   ev.preventDefault(); 
     }
 }else{
  
   if(ev.keyCode==116){
       ev.keyCode=0;
       ev.returnValue=false;
       parent.frames('mainframe').location.reload();
     }
 }
}

 html页面中的frameset

<frameset rows="104,*,29" frameborder="no" border="0" framespacing="0">
  <frame src="${ctx}/admin/common/back-header.action" name="topFrame" scrolling="no" style="width:100%;height:104px;visibility:inherit;z-index:1;margin:0;padding:0;border:none;" noresize>
    <frameset cols="203,6,*" frameborder="no" border="0" id=main_frm >
      <frame src="${ctx}/admin/common/leftmenu.action" name="leftframe" id=leftFrame scrolling="auto" noresize>
      <frame src="${ctx}/admin/common/framecontrol.action" name=navframe  noResize scrolling=no>
      <frame src="${ctx}/admin/common/admin-main.action" name="mainframe" scrolling="auto" noResize>
    </frameset>
      <frame src="${ctx}/admin/common/bottom.action" name="bottomframe" scrolling="no" noresize="noresize" id="bottomframe" title="bottomframe" />
</frameset>

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值