473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

javascript to disable the REFRESH functionality in a browser

By using javascript, is it possible to disable the REFRESH
functionality (F5 or refresh icon) in a browser?

Please advise. Thanks!!
Jul 23 '05 #1
6 27868
On 30 Jul 2004 16:34:33 -0700, Matt <jr********@hotmail.com> wrote:
By using javascript, is it possible to disable the REFRESH
functionality (F5 or refresh icon) in a browser?
No.
Please advise. Thanks!!


Happy to be of service. :)

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply
Jul 23 '05 #2
Matt wrote:
By using javascript, is it possible to disable the REFRESH
functionality (F5 or refresh icon) in a browser?
No. Besides, I use Ctrl(+Shift)+R for refresh in my Mozilla Firefox.
Please advise. Thanks!!


Revise your Web application. You're welcome, though this question has
been asked too much.
PointedEars
Jul 23 '05 #3
jr********@hotmail.com (Matt) wrote in message news:<ba**************************@posting.google. com>...
By using javascript, is it possible to disable the REFRESH
functionality (F5 or refresh icon) in a browser?
Why would you want to do this?

You cannot do this on the client. You could implement it on the
server by detecting a refresh and not doing the refresh. Don't ask me
how it is done, but I have seen it done on my local library book
renewal page. The library server program won't let me refresh the
page were I have the list of books checked out. The program forces me
to reenter my password before it will let me see my list of books.

Please advise. Thanks!!


Robert
Jul 23 '05 #4
Yes it is possible.

In a function capturing onkeydown, type:

event.keyCode = 0; //or any other number but F5
event.returnValue = false;
return false;

This works...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #5
Glen Spove wrote:
Yes it is possible.

In a function capturing onkeydown, type:

event.keyCode = 0; //or any other number but F5
event.returnValue = false;
return false;
And how, exactly, does that stop me from clicking the Refresh button?
This works...


No it doesn't, you just think it does.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #6
Glen Spove wrote:
Yes it is possible.
You are referring to something in particular? Maybe the disabling of the
refresh functionality in a web browsers? That is emphatically not
possible. (Hence multiple responses stating as much going uncommented by
others.)
In a function capturing onkeydown, type:

event.keyCode = 0; //or any other number but F5
Apart from the lack of discrimination in attempting to cancel all key
presses instead of just (the many) key sequences that would result in a
refresh action, to the best of my recollection only IE browsers allow
the assignment on values to keyCode events.
event.returnValue = false;
return false;

This works...


You are defining "works" as: works to inhibit only the use of the F5 key
to refresh the page, on javascript enabled default configurations of
Windows IE, but only when key events are passing through the document
(which they don't necessarily have to). The use of such a lax definition
of "works" means that whatever (harmful?) consequences follow from the
user refreshing the page, this script has done little more than reduce
the chances of them happening. So to exactly the extent to which those
consequences are undesirable, this proposal is inadequate.

Normal actions on the part of the client browser such as refreshing a
page, or moving back and forward in the history, or opening another
window showing the same URL (with Ctrl-N on Windows IE) should be
anticipated by the author of a server-side system that is to use a
browser client. They cannot be reliably prevented so instead they need
to be anticipated and accommodated in the design of the server-side
system. Failing to do that would be creating a web application that is
broken by design, and unsurprisingly the normal advice in that case is
to fix the server side.

Richard.
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Alex Molochnikov | last post by:
Is there any way to find out programmatically if Javascript is supported/enabled in a browser? By "programmatically" I mean on the Java servlet side. TIA Alex Molochnikov Gestalt Corporation
3
by: Marcus Otmarsen | last post by:
During the last months I obeserved a growing number of web pages with popups inside a web page. I don't know the technique by which these in-page-windows are implemented (either Javascript or...
8
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.