Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning to original page after alert box "OK"

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
When the user tries to exit the chat room I have an alert box which pops up and says please logoff properly. How would I make it so that when the user presses ok on that box, it returns to the original page?
 
Have you tried using history?
You know : window.history.back()

What happens instead anyway? If you add the alert before anything else happens then won't that leave the page how it is?

We need a bit more info, thanks, Ben. "Alright whatever man, I'll hook up the hair, but I aint touchin the ring though...Cause I'm still a pla--yer"
 
martiy6 -

you might want to check out webrefrence's article on the onbeforeunload event handler:
it only works for ie, but I am pretty sure that they have workarounds for netscape.

theEclipse
eclipse_web@hotmail.com
robacarp.webjump.com
**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top