Wednesday, July 16, 2008

How to Disable refresh button in web page

// Disable F5 button to disable refresh.

function checkKeyCode(evt)

{


 

var evt = (evt) ? evt : ((event) ? event : null);

var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);

if(event.keyCode==116)

{

evt.keyCode=0;

return false

}

}

document.onkeydown=checkKeyCode;


 


 

//Disable Right click

function Disable()

{

if (event.button == 2)

{

return false;

}

}

document.onmousedown=Disable;


 

Note: We cant control the refresh button of browser in general ways.

No comments: