开发者

How to disable refresh button once user goes on a particular web page?

I have to create a web page for a online quiz which will display same questions in different sequence for each user. Now, I have written code which takes questions randomly every time when user visit that page. User goes to that page by login id and password. I have used random function in query which gives questions in different order for each user. But now problem is w开发者_运维百科hen i refresh that page question order changes for the same user. So i wants to disable refresh button. Can you please tell me how to disable it? or is there any other way?


It's impossible to disable refresh button.

You can try to save questions order in users session and then use it.


You can't disable the button. You shouldn't be messing with the user's browser.

What you can do however, is to show a dialog asking the user if they want to leave the page.

<body onbeforeunload="return 'Are you sure you want to leave the page?';">


Just generate and store question order once per session or login instead of on every request.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜