How to simulate "Do you want to save changes" alert on web?

I want to alert user when they navigate away from an unsaved document in edit mode on web, what is a good way to do this?

sorry if it’s a simple question - I am new to the web stuff.

Thanks

Basir

Subject: RE: How to simulate “Do you want to save changes” alert on web?

there’s a javascript onunload event you can program – read about it in javascript references.

Subject: RE: How to simulate “Do you want to save changes” alert on web?

Thanks, I found some samples with onbeforeunload - should have search more before posting