jquery Disable Right-click, text-Select, refresh

Source: Internet
Author: User

//Disable Right-click, text-Select, Refresh$ (document). Bind ("ContextMenu", function () {return false;}); $ (document). Bind ("Selectstart", function () {return false;}); $ (document). KeyDown (function () {returnKey (arguments[0])}); //prompt warning when pressingfunction key (e) {varKeynum; if(Window.Event) {Keynum= E.keycode;//IE}Else if(E.which) {Keynum= E.which;//Netscape/firefox/opera}  if(Keynum = = -{alert ("Disable refresh!)  ”); return false; }  }    //Disable Right-click, text-Select, Refresh$ (document). Bind ("ContextMenu", function () {return false;}); $ (document). Bind ("Selectstart", function () {return false;}); $ (document). KeyDown (function () {returnKey (arguments[0])}); //prompt warning when pressingfunction key (e) {varKeynum; if(Window.Event)//IE{keynum=E.keycode; }              Else if(E.which)//Netscape/firefox/opera{keynum=E.which; }              if(Keynum = = -) {alert ("No Refresh! ");return false;} }          <script>//Shield right mouse button, CTRL + N, SHIFT+F10, F11, F5 refresh, backspace barfunction Document.oncontextmenu () {Event. returnvalue=false;}//masking the right mouse buttonfunction Window.onhelp () {return false}//Shielding F1 Helpfunction Document.onkeydown () {if(Window.Event. Altkey) &&(window.Event. keycode==Panax Notoginseng)||//masking ALT + arrow key ←(Window.Event. keycode== the))){//Shielding Alt + arrow keys →Alert"you are not allowed to use ALT + arrow keys to forward or rewind pages! "); Event. returnvalue=false; }         if((Event. keycode==8)||//Mask BACKSPACE Delete key(Event. keycode== the)||//Mask F5 Refresh key(Event. Ctrlkey &&Event. keycode== the)){//Ctrl+r           Event. keycode=0; Event. returnvalue=false; }           if(Event. keycode==122){Event. keycode=0;Event. returnvalue=false;}//Shielded F11      if(Event. Ctrlkey &&Event. keycode== +)Event. returnvalue=false;//Shielding CTRL + N      if(Event. Shiftkey &&Event. keycode==121)Event. returnvalue=false;//Shielded Shift+f10      if(Window.Event. srcelement.tagname=="A"&& window.Event. shiftkey) window.Event. returnvalue=false;//screen shift and left mouse button to open a new page      if(Window.Event. altkey) && (window.Event. keycode== the)){//Shielded Alt+f4Window.showmodelessdialog ("About:blank","","dialogwidth:1px;dialogheight:1px"); return false; }       }     </script>

jquery Disable Right-click, text-Select, refresh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.