473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Site Unload?

I want to have an onUnload that runs only when the site is left, not when
the current page is unloaded. Any ideas?

Thanks!

Ross
Jul 23 '05 #1
35 1822
Is there no solution?

"Ross M. Greenberg" <gr******@catsk ill.net> wrote in message
news:10******** *****@corp.supe rnews.com...
I want to have an onUnload that runs only when the site is left, not when
the current page is unloaded. Any ideas?

Thanks!

Ross

Jul 23 '05 #2
You will have to know before the unload where the client is going and
as far as I know there is no built in way of knowing that via the DOM.
The only way I can think of accomplishing this is to set an "isLeaving"
flag on every page of your site and default it to true. Whenever you
navigate to another page in your site you will have to set it to false.
Then in the unload you can check to see the status of the flag.

This method will probably turn into pain in the ass to do on every page
(although you may be able to trap most items with a script to chase
down onSubmit onClick events) but I can't think of a better way.
Anyone else?

Jul 23 '05 #3
Ross M. Greenberg wrote on 14 dec 2004 in comp.lang.javas cript:
I want to have an onUnload that runs only when the site is left, not when
the current page is unloaded. Any ideas?


"site is left" is not defined,
[unless you have a button saying "I solemnly declare to leave the site"]

With serverside ASP scripting you could do something ON THE SERVER when a
session ends. This is not very reliable and has no effect on clientside.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #4
Sigh. There has to be something for this!
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
Ross M. Greenberg wrote on 14 dec 2004 in comp.lang.javas cript:
I want to have an onUnload that runs only when the site is left, not when the current page is unloaded. Any ideas?


"site is left" is not defined,
[unless you have a button saying "I solemnly declare to leave the site"]

With serverside ASP scripting you could do something ON THE SERVER when a
session ends. This is not very reliable and has no effect on clientside.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 23 '05 #5
On Tue, 14 Dec 2004 14:30:41 -0500, Ross M. Greenberg
<gr******@catsk ill.net> wrote:
Sigh. There has to be something for this!


Why? There's no guarantee that the browser will actually execute *any*
code when the user chooses to close it.

[snip]

Mike
Please don't top-post.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #6
Ross M. Greenberg wrote on 14 dec 2004 in comp.lang.javas cript:
Sigh. There has to be something for this!


[Please do not topost on usenet]

No, you cannot detect something that is not defined.

"leaving a site" in the logical sense has no meaning to me.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #7
On Tue, 14 Dec 2004 19:33:27 GMT, Michael Winter
<M.******@bluey onder.co.invali d> wrote:
There's no guarantee that the browser will actually execute *any* code
when the user chooses to close it.


....or leave your pages.

What are you trying to achieve, and why?

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #8
For a commercial site, I want to open a survey page when they exit from the
site from any page, but not as they transit along the site's many pages.
"Michael Winter" <M.******@bluey onder.co.invali d> wrote in message
news:opsi0kwiy0 x13kvk@atlantis ...
On Tue, 14 Dec 2004 19:33:27 GMT, Michael Winter
<M.******@bluey onder.co.invali d> wrote:
There's no guarantee that the browser will actually execute *any* code
when the user chooses to close it.


...or leave your pages.

What are you trying to achieve, and why?

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

Jul 23 '05 #9

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
Ross M. Greenberg wrote on 14 dec 2004 in comp.lang.javas cript:
Sigh. There has to be something for this!


[Please do not topost on usenet]

No, you cannot detect something that is not defined.

"leaving a site" in the logical sense has no meaning to me.


It may not be formally defined, but how about "when the host changes"?

Jul 23 '05 #10

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

Similar topics

5
20855
by: Harry J. Smith | last post by:
I have written a Visual Basic program that does a long calculation and writes the results to disk as it runs. If I click the Close button the window closes but the program keeps running. How can I get the program to recognize that its window has been closed and quit running? -Harry http://home.netcom.com/~hjsmith
0
4089
by: razheev | last post by:
Hi, I have a Table which contains 1 million rows. I want to do an unload of the table and do some massaging (tranforming) of data and do a load to a different table where the column attributes are different. My question is 1) What options should I use to do a unload so that the unload is very fast using Platinum Fast unload. The table has many columns which defined as VARCHAR. 2)Is there a provision to convert the column values from...
2
10850
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload. When trying to delete the DLL file I get an exception that access is denied. When trying to copy over the DLL file, I get an exception that it is being used by another process.
1
2654
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 of my page in javascript. However, if I turn on smart navigation, any button that does a server.transfer fails to fire the javascript unload event.
1
2934
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 the unload event (client side not server side) of the <body> HTML element through javascript.
19
1743
by: Jon Davis | last post by:
I'm reposting this because I really need some advice. I have a web app that makes many queries to the database on every page. In order to save development effort, I've consolidated all database querying to methods in a single static class, so whenever I need data, I pass a SQL string to a method and I am passed a datareader or else individual values (string, integer, etc). There is a horrible memory leak in this application. Just one...
3
3214
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 the user perform operation on this page (postback navigation based). I also need to clean up the session data when the user leave the page (by a anyway). My question is about the Unload event, is it safe to use the unload
11
8658
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 do a Load too, but not an Unload. I just want the only the data from the table in a record sequential file. Export seems only to give options to have a delimited line sequential file or a record sequential file where the data is preceeded by...
5
2926
by: =?Utf-8?B?QW5keQ==?= | last post by:
As per the question really. Not trying to stop them leaving, but just detect WHEN they leave the site
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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
10177
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...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
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
7519
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
6750
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
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
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

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.