Advertisement
ferrynurr

Disabled Reload Page (F5 / CTRL+R)

Jun 12th, 2020
1,327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // bisa dikombinasikan dgn " window.open("ISI_URL_MU","mywindow","status=1,toolbar=0") " , agar tidak direfresh lewat button
  2.  
  3. document.onkeydown = function(e) {
  4. var key;
  5. if (window.event) {
  6. key = event.keyCode
  7. }
  8. else {
  9. var unicode = e.keyCode ? e.keyCode : e.charCode
  10. key = unicode
  11. }
  12.  
  13. switch (key) {//event.keyCode
  14. case 116: //F5 button
  15. key.returnValue = false;
  16. key = 0; //event.keyCode = 0;
  17. return false;
  18. case 82: //R button
  19. if (event.ctrlKey) {
  20. key.returnValue = false;
  21. key = 0; //event.keyCode = 0;
  22. return false;
  23. }
  24. case 91: // ctrl + R Button
  25. event.returnValue= false;
  26. key=0;
  27. return false;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement