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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

body onUnload

Status
Not open for further replies.

snowboardr

Programmer
Joined
Feb 22, 2002
Messages
1,401
Location
PH
I was wondering if anyone knew how to show a confirmation message such as gmail does if you try and close the window after you typed a message it shows a okay / cancel message. I already have this for all links and it works great, but I dont know how to get the message to work when they try and close the browser... I have tried onUnload, however that just shows the message after the tab in firefox is already closed...

thanks

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
Nevermind i found it! :)

Code:
 onbeforeunload="return DiscardMessage();"

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
It seems to be working well in

As this:
onbeforeunload="DiscardMessage();"

In Firefox & IE

But it does nothing in Opera... any suggests?

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
It doesnt seem like opera or safari have support at all, because even gmail doesnt show a message after closing with something typed in the compose window...

Hey do you know a way to "emulate" safari on pc?

Jason

[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top