views:

79

answers:

2

Is it possible that the html page loaded, cannot be refreshed or reloaded by the user

Thanks..

+10  A: 

No, and you shouldn't try to do this...it breaks all the users expectations of what a webpage does.

Whether it's code or behavior, when you're having trouble doing something, it's usually because it hasn't been done or hasn't been made easy...stop to ask why that is, and often you'll find there's a good reason.

Nick Craver
how can I make this +2?
Mark Schultheiss
And I will add that if you are writing a web "application" then you *must* gracefully handle the case where the user hits refresh at an inconvenient time. It will happen.
Sorpigal
Nick Please see my comment above
Hulk
+1  A: 

The onbeforeunload event could be used to detect a situation like this.

I think this is what SO uses when you write an answer and then want to leave before you post it; it asks you if you are sure.

Is that what you want to use it for or what?

dpb
No.Please look at my comment above..
Hulk
I will assume that this is a client-server application and not just a static page with JavaScript that takes care of everything. If that is the case, you could manage the timer server side. That will be immune to page refreshes by the user since the timer will be running outside of the reach of the client. You have more control on the server than the client, so the code should be easier (cleaner) to write.
dpb
Yes this is a client-server app and it is django .I will try with the server side coding in this case.Thanks.......
Hulk