• 前端项目通用、常用js common.js


      1 var url = location.href;
      2 
      3 if (url.toLowerCase().indexOf("/akweb_admin/") == -1) {
      4 
      5     function Click() {
      6 
      7         if (event.button != 1) {
      8 
      9             event.returnValue = false;
     10 
     11         }
     12 
     13     }
     14 
     15     document.onmousedown = Click;
     16 
     17  
     18 
     19     function key(e) {
     20 
     21         ////禁止Shift
     22 
     23         //if(event.shiftKey){
     24 
     25         //    return false;
     26 
     27         //}
     28 
     29         //禁止Alt
     30 
     31         if (event.altKey) {
     32 
     33             return false;
     34 
     35         }
     36 
     37         //禁止Ctrl
     38 
     39         if (event.ctrlKey) {
     40 
     41             return false;
     42 
     43         }
     44 
     45         return true;
     46 
     47     }
     48 
     49     //禁止键盘
     50 
     51     document.onkeydown = key;
     52 
     53  
     54 
     55     //if (window.Event)
     56 
     57     //document.captureEvents(Event.MOUSEUP);
     58 
     59  
     60 
     61     function nocontextmenu() {
     62 
     63         event.cancelBubble = true
     64 
     65         event.returnValue = false;
     66 
     67         return false;
     68 
     69     }
     70 
     71     function norightclick(e) {
     72 
     73         if (window.Event) {
     74 
     75             if (e.which == 2 || e.which == 3)
     76 
     77                 return false;
     78 
     79         }
     80 
     81         else
     82 
     83             if (event.button == 2 || event.button == 3) {
     84 
     85                 event.cancelBubble = true
     86 
     87                 event.returnValue = false;
     88 
     89                 return false;
     90 
     91             }
     92 
     93     }
     94 
     95     //禁右键
     96 
     97     document.oncontextmenu = nocontextmenu;  // for IE5+
     98 
     99     document.onmousedown = norightclick;  // for all others
    100 
    101     //禁止选取
    102 
    103     //document.onselectstart = function () { return false; }
    104 
    105     //禁止粘贴
    106 
    107     document.onpaste = function () { return false; }
    108 
    109     //禁止复制
    110 
    111     document.oncopy = function () { return false; }
    112 
    113     //禁止剪切
    114 
    115     document.oncut = function () { return false; }
    116 
    117 }
    浩楠哥
  • 相关阅读:
    ubuntu远程windows桌面
    spring boot 给返回值加状态 BaseData
    spring boot 拦截异常 统一处理
    IntelliJ IDEA spring boot 远程Ddbug调试
    IntelliJ IDEA 常用插件
    spring boot 请求地址带有.json 兼容处理
    spring boot 接口返回值去掉为null的字段
    spring boot 集成disconf
    Spring boot 自定义拦截器
    Linux下安装MySQL
  • 原文地址:https://www.cnblogs.com/haonanZhang/p/6220004.html
Copyright © 2020-2023  润新知