473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onUnload effect

Is there any way to get the same effect that the body tag onUnload creates.

I need a script that will be placed in the body of the html that will open a
new window when the parent is closed.
The window that will open is a survey for a webcast they just viewed.
I can't put the script in the header or place a onUnload command in the body
tag. Only place I can put it is in the
body of the page within a script file.

Thanks a bunch!
Rich
Jul 23 '05 #1
2 1639
<Ri**@NeedsHelp .com> kirjoitti viestissä:DI*** **************@ fe09.lga...
Is there any way to get the same effect that the body tag onUnload
creates.

I need a script that will be placed in the body of the html that will open
a
new window when the parent is closed.
The window that will open is a survey for a webcast they just viewed.
I can't put the script in the header or place a onUnload command in the
body
tag. Only place I can put it is in the
body of the page within a script file.

Thanks a bunch!
Rich


You can bind the onunload event to a function later in your code easily:

<html>
<head>
</head>
<body>
<script>
function foobar(){
alert("foobar") ;
}
window.onunload = foobar;
</script>
</body>
</html>

Just replace foobar with what you need to open the survey.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

et************* ***@5P4Mgmail.c om
Jul 23 '05 #2
Worked like a charm. Thanks alot.
Jul 23 '05 #3

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

Similar topics

3
8558
by: Andoni | last post by:
Hi, I am only writing for IE 5.5+ so no need for compatibility at all ;-) I am trying to get my users to logoff which they finish on a particular page. This is no problem (or should be no problem) as I can just put a location.replace('http://www.mysite.com/html/logoff.jsp'); into the onUnload event of the page they always finish on. ...
2
5645
by: Simon Wigzell | last post by:
I'm using OnUnLoad in my body statement to redirect to a function to clean things up if someone exits a form by closing it from outside the webpage code - e.g. by not using the cancel or save and exit buttons I have supplied but by clicking on the browser window top right X or closing it by clicking with the right mouse button on the tray icon...
6
15889
by: kaeli | last post by:
Hey guys, This error occurs ONLY in Netscape 7.0. Not in 7.1. So, I think it's a bug. Buuuut... Has anyone had this problem or know of a fix? When attempting to have an onunload function set with "window.onload=", the error comes up "permission denied to set property window.onunload"
3
6950
by: Laurent | last post by:
I am trying to use the onunload event to know when the user closes a popup by receiving a request on the web server. I have a main page from where the user opens a popup. What I want is when the user closes the popup, it sends a request to my web server (GoAhead) using the onunload event, then closes the popup. For the moment, this what i...
3
5868
by: =B= | last post by:
Hi all, I was wondering if anyone has had any luck with trapping the <BODY> onUnload() event in ASP.NET? The thing is, I'm writing code for an Intranet site. The code makes a call to a third-party component (think of it as a lock) when the page loads. Now the OK and Cancel server buttons I can handle and use to release the lock as...
1
1516
by: Tim Arview | last post by:
Hi, I'm trying to create an exit popup that doesn't require anything added to the body tag. In other words, I don't want to say <body onunload="foo">. I just want to have window.onunload="foo" in the <scripttag. However, when I do that, it launches foo as soon as the page loads and does NOT launch when the page is unloaded.
0
11826
acoder
by: acoder | last post by:
Problem onload and onunload events do not fire when going back, forward or refreshing the page Browser Opera Example Any code using onload or onunload, e.g. window.onload = init; where init() is a function which initialises some variables (for example).
0
7912
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...
0
7839
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...
0
8202
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. ...
0
8338
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...
0
6614
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...
1
5710
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...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.