473,406 Members | 2,956 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,406 software developers and data experts.

Preventing unload .

Hi,

How to stop unloading a page in the event handler called during
onUnload?

onUnload=unloadhandler();

function unloadhandler()
{
if(!confirm("message"))
{
I want something to be done which prevents the page from
unloading and returns to the same page as 'back' functionality
}

}

Jul 23 '05 #1
7 8893
So you want the user to have to close the browser to get away from your site
?
They will love that! and will never return.

"Nithya Venkatachalam" <vn*****@gmail.com> wrote in message
news:ch********@odbk17.prod.google.com...
Hi,

How to stop unloading a page in the event handler called during
onUnload?

onUnload=unloadhandler();

function unloadhandler()
{
if(!confirm("message"))
{
I want something to be done which prevents the page from
unloading and returns to the same page as 'back' functionality
}

}

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004
Jul 23 '05 #2
Nithya Venkatachalam wrote:
Hi,

How to stop unloading a page in the event handler called during
onUnload?

onUnload=unloadhandler();

function unloadhandler()
{
if(!confirm("message"))
{
I want something to be done which prevents the page from
unloading and returns to the same page as 'back' functionality
}

}


Ignoring the fact that this is a very bad idea and an easy way to piss
users off, have you tried simply making unloadhandler() return FALSE?

--
Jasper Bryant-Greene
Cabbage Promotions
Jul 23 '05 #3
On 30 Aug 2004 21:33:44 -0700, in comp.lang.javascript you wrote:
I want something to be done which prevents the page from
unloading and returns to the same page as 'back' functionality


(guest)
I want a different page, ..no, *site*.

BTW - Do not set follow-ups by email Nithya,
this is not your personal 'help-desk', it is
a *discussion* *forum*!

[ My newsreader is not even configured for
sending email, as it happens. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4
Andrew Thompson wrote:
On 30 Aug 2004 21:33:44 -0700, in comp.lang.javascript you wrote:

I want something to be done which prevents the page from
unloading and returns to the same page as 'back' functionality

(guest)
I want a different page, ..no, *site*.

BTW - Do not set follow-ups by email Nithya,
this is not your personal 'help-desk', it is
a *discussion* *forum*!


Does Google allow setting the follow-up? I have never posted from
groups.google so I am curious.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #5
On Tue, 31 Aug 2004 02:18:22 -0400, Randy Webb wrote:
BTW - Do not set follow-ups by email Nithya,
this is not your personal 'help-desk', it is
a *discussion* *forum*!


Does Google allow setting the follow-up? I have never posted from
groups.google so I am curious.


I had not noticed the OP was posting from Google!

Bad, ..bad Google. Stop it*.

* allowing people on a web-based access
to usenet to set email follow-ups..

Wait.. what is that I hear? Is it the stampede
of Google web-app programmers rushing to change
the Google 'groups' interface based on the
complaint of one random usenaut? ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #6
On Tue, 31 Aug 2004 16:54:37 +1200, Jasper Bryant-Greene
<ja**@fatalnetwork.com> wrote:
Nithya Venkatachalam wrote:
[trying to stop unload]

I have a distinct feeling of déjà vu here. Oh yes. That's because you
already posted this question (twice).
Ignoring the fact that this is a very bad idea and an easy way to piss
users off, have you tried simply making unloadhandler() return FALSE?


That won't work. The unload event can't be cancelled (thank goodness).
Besides, my browser doesn't fire the event at all when I close a tab, or
the browser itself. Trying to rely on this approach is a very bad idea.

Randy Webb does propose another approach in the original incarnation of
this thread (posted yesterday), which will work in IE and Mozilla.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #7
Don't be such a pisser, beforehand assuming the guy has malintentions.

I have exactly the same question and my motive for it is that I am building
a web *application* for the employess at the office. They shouldn't be able
to shut the application with Alt-F4 for many good business-reasons (like
logging, making sure their work is properly saved, etc.)

Ray

"Hal Rosser" <hm******@bellsouth.net> wrote in message
news:Pm*******************@bignews1.bellsouth.net. ..
So you want the user to have to close the browser to get away from your site ?
They will love that! and will never return.

"Nithya Venkatachalam" <vn*****@gmail.com> wrote in message
news:ch********@odbk17.prod.google.com...
Hi,

How to stop unloading a page in the event handler called during
onUnload?

onUnload=unloadhandler();

function unloadhandler()
{
if(!confirm("message"))
{
I want something to be done which prevents the page from
unloading and returns to the same page as 'back' functionality
}

}

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004

Jul 23 '05 #8

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

Similar topics

2
by: DC Gringo | last post by:
I recently added a machine with Visual Studio.NET 2003 on a Win2k sp4 SERVER machine and am having problems with roaming profiles. Apparently the Machine Debug Manager (mdm.exe) service is holding...
1
by: hal | last post by:
I have an application that includes an activex component that consumes resources that must be released when the a page is unloaded. Toward this end I subscribe to the unload event of the body...
1
by: Hal | last post by:
My most sincere gratitude to anyone who can help me work around this! I have work that needs to be done in javascript on the client whenever a page is unloaded. To this end, I subscribe to...
3
by: Gauthier Segay | last post by:
Hello, I've an application where all my pages implement a PAGE_CODE string property, this property is stored in HttpContext.Current.Items. In some page, I must persist data in session while...
4
by: microb0x | last post by:
I have an application with a master form with a tab control containing nine tabs, each tab contains a subform. I have command buttons on my main form including: Save , Cancel , Close. My...
11
by: Timofmars | last post by:
I'm try to Unload DB2 data from a table into a record sequential file on NT. I can an unload on Mainframe, but it doesn't seem to be an option in NT. In NT, all I can do is export/import. I can...
2
by: noneya22 | last post by:
I'm using asp.net 2.0. I have a page that has a save button and a cancel button along with a text field. All controls are asp.net server controls. I have JavaScript that prompts the user if he...
0
vdraceil
by: vdraceil | last post by:
Hi,i use VB6.0..is it possible to prevent a form from unloading ever? I know to set cancel=true in query unload event of the form..but this applies only to limited cases. If my exe is closed from...
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: 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:
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
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,...
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
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,...
0
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...

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.