disable the F5 and Refresh button using Javascript

if (document.all){
document.onkeydown = function (){
var key_f5 = 116; // 116 = F5

if (key_f11==event.keyCode){
alert("F5 pressed");
return false;
}
}
}
function document.onKeyPress()
{
if(event.keyCode=116)return false;
}

Nhận xét

  1. Thanks bạn rất nhiều, mình đang search mỏi cả mắt về thằng này.

    Trả lờiXóa
  2. :))
    Thấy code hay hay mình lưu lại thôi.

    Trả lờiXóa

Đăng nhận xét

Bài đăng phổ biến từ blog này

Here you must distinguish between the several partitions

xajax dhtmlHistory-Extension (Bookmark and Backbutton)

Model-View-Controller Component - Part 2 - Adding a Model