473,799 Members | 2,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PREVENTING F5 REFRESH IN NETSCAPE 7.1

I can't seem to prevent the refresh associated with F5 in Netscape. I
can capture the key but returning false does not prevent the refresh.
The code is as follows:

function keyDown(e) {

if (navigator.appN ame == 'Netscape') {
if(e.which == 116) {
alert('This action is prohibited');
e.cancelBubble = true;
return false;
}

}

// IE gives me no problem at all...
if (navigator.appN ame == 'Microsoft Internet Explorer') {
if (window.event.k eyCode == 116) {
window.event.ke yCode = 0;
alert('This action is prohibited');
return false;
}
}
}

document.onkeyd own = keyDown;
if (navigator.appN ame == 'Netscape')
document.captur eEvents(Event.K EYDOWN)

Thanks in advance.
Jul 23 '05 #1
2 2612
Obi Wan Shinobi wrote:
I can't seem to prevent the refresh associated with F5 in Netscape. I
can capture the key but returning false does not prevent the refresh.


*sighs*

You shouldn't be trying to stop the user from refreshing the browser, or
using the back button, or closing windows without logging out.

HTTP is a _stateless protocol_. Embrace the fact that HTTP-based
applications are different from stateful ones. You have much Much MUCH
less control over the client environment in which it runs.

You solve the problems of statefulness on the server, where you have
absolute control over the environment.

This means you deal with browser reloads on the server, you deal with the
possibility the user might click back on the server, you deal with
expiring user sessions on the server.

Trying to make an HTTP-based application behave like a standalone
executable leads to a lot of time spent "solving" problems which can not
be solved.

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Obi Wan Shinobi wrote:
I can't seem to prevent the refresh associated with F5 in Netscape. [...]


And that is good so.
PointedEars
Jul 23 '05 #3

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

Similar topics

5
4618
by: Bruce | last post by:
I have a number of forms that do significant work based on variables POSTed from the form. What is the common method of detecting and preventing this work from being done when the form is POSTed as the result of the user clicking the Back or Reload buttons in the browser? --Bruce
11
29579
by: Tom Post | last post by:
I am doing a simple php header refresh -- header('refresh: 10; url=msgs.php'); that just does a call back to my script every 10 seconds. Things work great when the page is first loaded up, but if the end user hits F5 or the refresh button, then the page stops refreshing indefinately. Any ideas how to make it so that the page perpetually refreshes regardless of what the end user presses?
6
14409
by: Andrus Moor | last post by:
I want to add a refresh button to my web page which works like browser refresh button: it must re-load current page from server. How to implement this in javascript ?
43
16091
by: dan baker | last post by:
I have a page that gets loaded with a meta-refresh hardcoded so that a few things on the page get updated. its kind of a fake chat board. anyway, what I need to do is turn off the meta-refresh once someone clicks in a <textarea> to enter their input; otherwise the refresh catches them in the middle and messes up the focus. I need a way to turn off the meta-refresh, or to force the cursor/focus to stay in the message input box once they...
2
1886
by: Tipu Sattar | last post by:
Does anyone know how the refresh is trapped at www.nwolb.com. It seems to trap the refresh, using F5 key as well as the reload button, and gives the user a pop to allow them to continue or cancel the event. I've looked at the source code and it does not seem to be in there. I also know that they only support IE - so is/ could it be IE specific? Thanks T
4
1921
by: Jonas | last post by:
Hi! I have a web page where I want to intercept keypress events in an INPUT-tag and check if it is the Enter key, which calls another function that executes a search. My code runs on Netscape 7 for Windows, IE 6 for Windows and IE5.1 for Mac, but not on Netscape 7 for Mac. When I press the Enter key, the event gets caught but it does not get prevented and the search is never executed. The code looks like this:
2
3440
by: pingalkar | last post by:
In my application, on one form i m getting information from user and save this information , after saving this information again we loading that page. (At this moment if any one try to refresh this page, then save action will call) this should not be happen. only data will save , when we click on the save button. Why every refresh save action getting call and what is solution on this problem? Is there any javascript method available to...
2
1858
by: philbo30 | last post by:
I have data processing that takes place via an application written in C. I also have a .php webpage that displays a chart of the results via the Netscape 4.79 browser. Currently, manual intervention is required to refresh the web page and show the process results. I need to fully automate this process. In a nutshell, the browser window needs to be automatically refreshed as soon as my application completes its processing. In other...
9
4140
by: Navaneet | last post by:
Hi, Can anyone tell me how to prevent some particular POST DATA when refresh button (F5) clicked on server side(vb.net). Thanks Kumar N
0
9687
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
10485
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...
1
10231
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9073
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
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
6805
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.