473,327 Members | 1,979 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,327 software developers and data experts.

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.appName == 'Netscape') {
if(e.which == 116) {
alert('This action is prohibited');
e.cancelBubble = true;
return false;
}

}

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

document.onkeydown = keyDown;
if (navigator.appName == 'Netscape')
document.captureEvents(Event.KEYDOWN)

Thanks in advance.
Jul 23 '05 #1
2 2590
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*****@agricoreunited.com>
comp.lang.javascript 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
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...
11
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...
6
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
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...
2
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...
4
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...
2
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...
2
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...
9
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.