window.event is undefined
原因是火狐不兼容
<script language="Javascript">

document.oncontextmenu = function() {
return false;
};
document.ondragstart = function() {
return false;
};
document.onselectstart = function() {
return false;
};
document.onbeforecopy = function() {
return false;
};
document.onselect = function() {
document.selection.empty();
};
document.oncopy = function() {
document.selection.empty();
};
document.onmouseup = function() {
document.selection.empty();
};

function DisableF5() {
with (event) {
// F5 and Ctrl+R
if (keyCode == 116 || (ctrlKey && keyCode == 82)) {
event.keyCode = 0;
event.cancelBubble = true;
return false;
}
}
}
document.onkeydown = DisableF5;
var check=function(e){
e=e||window.event;
//alert(e.which||e.keyCode);
if((e.which||e.keyCode)==116){
if(e.preventDefault){
e.preventDefault();}
else{event.keyCode = 0;
e.returnValue=false;}
}
};
if(document.addEventListener){
document.addEventListener("keydown",check,false);
}
else{
document.attachEvent("onkeydown",check);
}

</script>