473,802 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 27913
On 30 Jul 2004 16:34:33 -0700, Matt <jr********@hot mail.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********@hotm ail.com (Matt) wrote in message news:<ba******* *************** ****@posting.go ogle.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.returnVal ue = 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.returnVal ue = 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.javas cript 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.returnVal ue = 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
8486
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
6752
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 HTML?). They contain a "close" resp. "x" button/link to click them away. They are however not detectable by "normal" popup blockers. How can I otherwise turn these popup windows automatically (!) off otherwise? Marcus
8
2856
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 :) >. I've read quite a few posts on how to do this, but none meet my need (the two main suggestions was set a jsEnabled variable in a <scriptsection of the HTML and read it in PHP, and the other suggestion was by default loading the non js page,...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10536
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10304
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.