js源碼收集

來源:互聯網
上載者:User

標籤:js

(function() {    var doc = document,    ua = navigator.userAgent.toLowerCase(),    check = function(r) {        return r.test(ua);    },    isOpera = check(/opera/),    isChrome = check(/chrome/),    isWebKit = check(/webkit/),    isSafari = !isChrome && check(/safari/),    isSafari2 = isSafari && check(/applewebkit\/4/),    isSafari3 = isSafari && check(/version\/3/),    isSafari4 = isSafari && check(/version\/4/),    isIE = !isOpera && check(/msie/),    isIE7 = isIE && check(/msie 7/),    isIE8 = isIE && check(/msie 8/),    isIE9 = isIE && check(/msie 9/),    isIE10 = isIE && check(/msie 10/),    isIE11 = isIE && check(/msie 11/),    isIE6 = isIE && !isIE7 && !isIE8 && !isIE9 && !isIE10 && !isIE11,    isGecko = !isWebKit && check(/gecko/),    isGecko2 = isGecko && check(/rv:1\.8/),    isGecko3 = isGecko && check(/rv:1\.9/);    function preventKey(e) {        var ev = e || window.event,        //擷取event對象 obj = ev.target || ev.srcElement,//擷取事件來源 t = obj.type || obj.getAttribute('type'),readonly = obj.readOnly||obj.getAttribute('readonly'), code = ev.keyCode||ev.which||ev.charCode,charcode = String.fromCharCode(code).toLowerCase();//擷取事件來源控制項類型,控制項唯讀屬性,鍵盤值 if ( (code == 8 && t != "password" && t != "text" && t != "textarea")||(readonly&&(t == "password" || t == "text" || t == "textarea"))) {//除不唯讀輸入框外禁止後退鍵 return false; } if (((isOpera || isGecko)?ev.which==0:true)&&(code == 116 || code == 122|| code == 123 || (ev.shiftKey && code == 121))||(((isOpera || isGecko)?ev.which!=0:true)&&ev.ctrlKey && (charcode == 'a' || charcode == 's'))) {//屏蔽 F5,F11,F12,shift+F10,ctrl+a,ctrl+s if (isIE) ev.keyCode = 0; ev.returnValue = false; return false; } }; if (isOpera || isGecko) doc.onkeypress = preventKey; else if (isIE || isChrome || isSafari) doc.onkeydown = preventKey; if(isIE)document.onselectstart=function(){return false;}; doc.oncontextmenu = function(){ if(window.event){ window.event.cancelBubble = true; window.event.returnValue=false; } return false; }; try{window.history.forward(1);}catch(e){} })();        

js源碼收集

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.