General discussion

Locked

Javascript close window event

By madhu_telajala ·
i want to capture the close window event in javascript. How can i do. I don't want to use OnUnload function.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Javascript close window event

by Jay Eckles In reply to Javascript close window e ...

There is no "onClose" event, for instance. You can try doing something like

<script for="window" event="onClose" language="javascript>...</script>
But I doubt it will work. You might try the same for onUnload, but I suspect it will fire when the document unloads, if ever.

The best workaround I've found is to nest websites in a frameset with one hidden frame. Use the onUnload event in that frame, and you'll get notified when the user either closes the window or goes directly to a URLusing the address bar. It is not possible to distinguish the difference between a user closing a window and the user going to another page.

Sorry.

Jay Eckles
www.jayeckles.com

Collapse -

Javascript close window event

by madhu_telajala In reply to Javascript close window e ...

The question was auto-closed by TechRepublic

Collapse -

Javascript close window event

by GIJoe In reply to Javascript close window e ...

Is this still a problem?

Collapse -

Javascript close window event

by madhu_telajala In reply to Javascript close window e ...

The question was auto-closed by TechRepublic

Collapse -

Javascript close window event

by madhu_telajala In reply to Javascript close window e ...

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums