You have started writing or editing a post.
views:
80answers:
3
+7
A:
you'll need to do ajax polling for the "load new answers" alert that appears whilst you are writing an answer.
Here's a nice tutorial for ASP.NET using jQuery
For the alert when you attempt to navigate away from a page when you have started typing an answer/ editing a post, look at the onunload
event. A confirm
dialog is used as opposed to an alert
Russ Cam
2009-09-15 08:27:32
A:
Are we talking about SO warning you when you try to navigate away from a page with a partially filled in comment/answer ? Check out the onunload()
method in Javascript. See here for an example.
Brian Agnew
2009-09-15 08:28:50
I mean what the popup dialog really is?It's similar to an alert,but it's not.
Shore
2009-09-15 08:31:01
I think your question may need rephrasing or clarification
Brian Agnew
2009-09-15 08:32:15
A:
add this script to the head portion of your page:
<script language="javascript">
window.addEventListener('beforeunload', onUnload, false);
function onUnload(e)
{
e.returnValue = "some Text";//this is your message
e.preventDefault();
}
</script>
Amarghosh
2009-09-15 08:52:16