• html iframe禁用右键


    <!doctype html>
    <html lang="en">
     <head>
      <meta charset="UTF-8">
      <meta name="Generator" content="EditPlus®">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
      <title>Document</title>
     </head>
    
    
     
       <script type="text/javascript">
          document.oncontextmenu = function(){     
              return false;
          } 
    
     
      </script>
    
    
    
     <body  >
     
    
     
    
      <iframe id="ifm" height="100%" width="100%" marginwidth ="0" marginheight="0"   src="http://localhost/abc.html"></iframe>
     
     </body>
    
      <script type="text/javascript">
          var iframe = document.getElementById('ifm');
    iframe.onload=function(){
      iframe.contentWindow.document.oncontextmenu=function(){return false;};
      iframe.contentWindow.document.onselectstart=function(){return false;};
    };
    
      </script>
    
    </html>
    document.oncontextmenu = function(){     
              return false;
    }


     var iframe = document.getElementById('ifm');
    iframe.onload=function(){
      iframe.contentWindow.document.oncontextmenu=function(){return false;};
      iframe.contentWindow.document.onselectstart=function(){return false;};
    };
  • 相关阅读:
    OSCache报错error while trying to flush writer
    html 输入框验证
    Struts2 一张图片引发的bug
    Html 小插件10 即时新闻
    String
    内部类
    多态
    抽象&接口
    继承
    封装
  • 原文地址:https://www.cnblogs.com/shihaiming/p/13273952.html
Copyright © 2020-2023  润新知