I am not talking about that. That is easy to do. This is a different
situation. After opening the popup, the URL of the parent window changes. So
the new window pointer will be lost. Is there a way to save the window
pointer in a global location or is it possible to retireve the popup
window's reference later by using the "window name"?
Hope you follow what I explained.
Thanks
Nithi Gurusamy
> > Dear Group:
> >
[quoted text clipped - 11 lines]
> >
> The return value of window.open gives you the pointer to the new window.
Walter Zackery - 21 Oct 2003 15:41 GMT
You can retrieve a reference to a window knowing only its name. The only
hitch to this is the possibility of more than one window (and/or frame)
currently open with the same name. In that case, one window or frame will be
referenced, but you have no control over which one.
var win = window.open("","popupWindow");
| I am not talking about that. That is easy to do. This is a different
| situation. After opening the popup, the URL of the parent window changes. So
[quoted text clipped - 22 lines]
| > >
| > The return value of window.open gives you the pointer to the new window.
Nithi Gurusamy - 21 Oct 2003 15:48 GMT
Dear Group:
I unknow we can use onunload events of window and body objects to detect
when the URL changes. But is there a event that tells me the Internet
Explorer or Netscape window itself is closing?
Thanks
Nithi Gurusamy
Raffaele Rialdi [MVP] - 21 Oct 2003 20:28 GMT
> [...] But is there a event that tells me the Internet
> Explorer or Netscape window itself is closing?
No you have to detect by yourself what caused the page to be unloaded.
Look at the sample below
If you are thinking to use the unload event to do something (free resource
for example) on the server, you are going in the wrong direction.
Http is a disconnected protocol and you should never rely on what's
happening on the client. Client can cut the wire, crash the system, kill the
browser and this should not cause any problem on your server.
You should use Session_End event instead that will happen after 20min
(default) from the last request.

Signature
Raffaele Rialdi
Microsoft .NET MVP http://mvp.support.microsoft.com
UGIdotNET - User Group Italiano .NET http://www.ugidotnet.org
<HTML>
<HEAD>
<SCRIPT>
var ctlClicked
function Load()
{
ctlClicked = false;
alert("evento onLoad");
}
function GoingAway()
{
if(ctlClicked == false)
alert("Maybe you are closing the browser");
}
function ctlclicked()
{
if(event.srcElement.tagName == "A")
{
ctlClicked = true
alert("evento onclick dal controllo '" + window.event.srcElement.id +
"'");
}
}
function DivClick()
{
alert(window.event.srcElement.parentElement.nextSibling.id);
var Elem = window.event.srcElement.parentElement.children(1);
if(Elem.style.display == "none")
{
Elem.style.display = "";
}
else
{
Elem.style.display = "none";
}
}
function DivOver()
{
window.event.srcElement.style.cursor='hand';
}
function DivOut()
{
window.event.srcElement.style.cursor='auto';
}
</SCRIPT>
</HEAD>
<BODY onload="Load()" onclick="ctlclicked()" onbeforeunload="GoingAway()"
language=javascript>
<h1>Hello, world</h1>
<h3>by Raffaele Rialdi, esempio postato su ugidotnet</h3>
<a id=myLink href=http://www.ugidotnet.org>Questo ? un link</a>
<Div>
<div language=javascript OnClick="return DivClick();" onmouseover="return
DivOver();" onmouseout="return DivOut();"> Titolo</div>
<div>Hello, world!</div>
</Div>
<div id=shad>shadow</div>
</BODY>
</HTML