zoukankan      html  css  js  c++  java
  • 如何实现ie禁止返回功能和禁止用户用back space键返回页面(未测试)

    function   setBSkey()   {  
      var   blnEevntCancel   =   false   ;  
       
              if   (window.event   &&   window.event.altKey   &&   (window.event.keyCode   ==   8   ||   window.event.keyCode   ==   37   ||   window.event.keyCode   ==   39   ))   {  
                      blnEevntCancel   =   true   ;  
              }  
      if   (   window.event.keyCode   ==   8   )   {  
      if   (window.event.srcElement.tagName.toUpperCase()   ==   "TEXTAREA")   {  
      if   (   window.event.srcElement.readOnly   ==   true   )   {  
                      blnEevntCancel   =   true   ;  
      }  
      }  
    else   if   (window.event.srcElement.tagName.toUpperCase()   ==   "INPUT"   &&   event.srcElement.type.toUpperCase()   ==   'TEXT')       {  
      if   (   window.event.srcElement.readOnly   ==   true   )   {  
                      blnEevntCancel   =   true   ;  
      }  
      }   else   {  
                      blnEevntCancel   =   true   ;  
      }  
      }  
      if   (blnEevntCancel   ==   true   )   {  
      window.event.cancelBubble   =   true;  
              window.event.returnValue   =   false;  
              return   false;  
      }  
      }

  • 相关阅读:
    【codevs1515】 跳
    【bzoj1227】 SDOI2009—虔诚的墓主人
    【bzoj3505】 Cqoi2014—数三角形
    【bzoj1059】 ZJOI2007—矩阵游戏
    【poj2122】 Optimal Milking
    【poj2455】 Secret Milking Machine
    【poj3084】 Panic Room
    【poj2699】 The Maximum Number of Strong Kings
    【bzoj3218】 a + b Problem
    【bzoj3122】 Sdoi2013—随机数生成器
  • 原文地址:https://www.cnblogs.com/RuiLei/p/549266.html
Copyright © 2011-2022 走看看