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

Recognize reload and enter command

How can I understand when auser of the web page pres the reload button
of the web browaser or when he press enter in the line where the
internet address is inserted? I'd like capture this event to manage it.

Thanks,
Marco
Jul 23 '05 #1
3 1753
my****@yahoo.it wrote:
How can I understand when auser of the web page pres the reload button
of the web browaser or when he press enter in the line where the
internet address is inserted?


You can't distinguish reloading from entering an URL, following a link,
or closing the browser window. All of these user actions simply cause
an unload event.

ciao, dhgm
Jul 23 '05 #2
> You can't distinguish reloading from entering an URL, following a link,
or closing the browser window. All of these user actions simply cause
an unload event.

Argh!
In my web page where I use javascript I can see that IE e Mozilla have
different behaviours!

How can I capture the unload event with javascript?

Thank very much,
Marco
Jul 23 '05 #3
In article <o_**********************@news4.tin.it>, my****@yahoo.it
wrote:
How can I capture the unload event with javascript?


Here is an example html file. I do not recommend pestering the user
when doing an onunload. New browsers limit what can be down in the
onunload event.

Robert

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>onunload tests</title>
<script type="text/javascript">

function leaving()
{

var newWindow;
newWindow = window.open(
"http://www.yahoo.com",
"debug",
"scrollbars,resizable,location,width=700,height=50 0");

alert("please come back soon.");
}
</script>
</head>
<body onunload="leaving()">
<p>Let's pester the user when leaving our window.
</p>
</body>
</html>
Jul 23 '05 #4

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

Similar topics

2
by: Steve | last post by:
I'm working in PHP, but am also using JavaScript, so perhaps there is a better way to do this using more PHP code...... I setup a search screen for my database, the user enters data and submits...
66
by: Ellinghaus, Lance | last post by:
> > Other surprises: Deprecating reload() >Reload doesn't work the way most people think >it does: if you've got any references to the old module, >they stay around. They aren't replaced. ...
2
by: Chris | last post by:
Hello, I have an input box and a button and when the user clicks the button, the contents of the input box are placed on the page in list form. But, when the enter key is used it's as if the page...
18
by: Alan Z. Scharf | last post by:
1. I have a chain of six asynch callbacks initiated by a button, and want the page to refresh at the end of each callback to display A. Results of a SQLServer query showing cumulative running...
9
by: David Veeneman | last post by:
I'm just getting started with ASP.NET, using VS 2005. As an exercise, I opened the root web site in VS 2005 and created a simple welcome page. I saved the page as Default.aspx and made sure that...
2
by: gen_tricomi | last post by:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) on win32 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal...
1
by: bernhard.voigt | last post by:
Hey! I'm using ipython as my python shell and often run scripts with the magic command %run: In : %run script.py If modules are loaded within the script these are not reloaded when I rerun...
3
by: Stef Mientki | last post by:
hello, I've a graphical application (wxPython), where the code in the main GUI loop is given below. 1 JAL_Loaded = False 2 while len(App_Running) 0: 3 if JALsPy_globals.State...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...
0
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...

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.