开发者

Disable browser refresh button

开发者 https://www.devze.com 2023-02-20 18:25 出处:网络
I am developing one online examination system, in that i want to disable refresh button of browser in particular page. how it is possible? i tried by usi开发者_StackOverflow社区ng JavaScript but it is

I am developing one online examination system, in that i want to disable refresh button of browser in particular page. how it is possible? i tried by usi开发者_StackOverflow社区ng JavaScript but it is not working..

Thanx in advance........


it is forbidden by security policy


set a 'cookie' when the person who is taking exam is logged in,

from now, you check if the person is logged out or not,

write your page load code in such a way that, it has 2 ways, first goes to refreshing the page for new user to login if the user is already logged out, other loads the page where the user is with the same data set on the screen he had before reset.

alternative way:

store values in cookies and dynamically use browser's "back" button to retrive the page he was on after reload. then fill the values back from cookies.


you can do by script only.....i.e first u need know ASCII codes of buttons in our keyboard...

    document.onkeydown=function()
    {
 switch(event.keycode)
{
case 116:event.return value=false;
    event.keycode=0;
    return false;
case 82:if(event.ctrlkey)
{
event.returnvalue=false;
event.keycode=0;
return false;
}}
}
0

精彩评论

暂无评论...
验证码 换一张
取 消