Archive of UserLand's first discussion group, started October 5, 1998.

Re: Scripting Question

Author:Jim Lyon
Posted:9/20/2000; 2:38:56 PM
Topic:Scripting Question
Msg #:21553 (In response to 21541)
Prev/Next:21552 / 21554

If I want a pop up window to happen when the user closes the window or types in and goes to a new URL, but NOT if they hit the back or forward buttons, does anybody know how I could script that?

I hope you'll rethink your requirements. By the time a user hits a button to go somewhere else, his mind is already on the somewhere else. For you to pop up a window relevant to what he just left is to intrude rather rudely on his consciousness.

If you insist on doing this anyway, fortune.com has a big pile of javascript that tries to do the same thing. It's not exact, but is a fair approximation.

For myself, I've patched the object code of my browser to completely ignore onUnload methods, just so that I don't have to put up with sites that do what you're trying to do.




This page was archived on 6/13/2001; 4:56:47 PM.

© Copyright 1998-2001 UserLand Software, Inc.