Hi all,
Before the user can close a page, I would like to have a message come up that asks if this is really what they want to do. the page needs to stay open.
I got this, edited, from msdn
function closeIt()
{
event.returnValue = "";
}
<body onbeforeunload="closeIt()" >
It works just fine, too well. I get the message when the user refreshes the page, something I do not want.
Any thoughts?
Also with the above, I don't like the alert message and would like to have it read differently. Suggestions on this...
Hi,
maybe not the right way to have done it, but the opening page has data on it to which other pages refer. I need to keep that initial page open so that the user can transfer data from the secondary page to the opening page.
Webpages are transient- Generally we save data on the server, in files or databases, uploaded from our pages.
You can pass a couple kbs of data between pages in a cookie, or a hundred characters or so on the url, but how much data can you use that doesn't belong on the server, where any page you allow can access it?
Hi
yes, I agree, pages are transient
and for among the various reasons listed above, this is what I'd like to do. The data does eventually end up on the server.
so, all other issues aside... what is possible?
thanks
Hi
yes, I agree, pages are transient
and for among the various reasons listed above, this is what I'd like to do. The data does eventually end up on the server.
so, all other issues aside... what is possible?
thanks
be a man/woman and tell the lamebrain idiots who need this feature that they suck at using a computer.
this type of feature is needed for moronic asses who do not back up their own work and every time I need to do my work, I have to click an idiot button to post. not funny at all.
You can use the proprietary onbeforeunload event handler to popup a confirm message in those browsers that support it but the only standard event that runs when a page is being unloaded is the onunload handler that doesn't run until after it is too late for them to change their minds.
window.onbeforeunload = function() {return confirm('Ready to leave?');};
window.onunload = function() {alert('bad luck if you forgot to backup');};
Bookmarks