Steps to reproduce:

  1. Go to a question
  2. Type an answer
  3. Delete contents of the answer
  4. Click on a link such as Unanswered

IE7/8: The error message will read null instead of the normal You have started writing or editing a post.

Firefox: Nothing happens and you are taken to the link without being prompted.

4 Answers 4


This is fixed in the next push.

I was returning null in the onbeforeunload handler instead of not returning anything, e.g.:

// incorrect behavior in IE
window.onbeforeunload = function() {
   return (hasUserEnteredText) ? "You've started writing a post!" : null;

// correct behavior everywhere!
window.onbeforeunload = function() {
   if (hasUserEnteredText)
      return "You've started writing a post!";

I'm not getting any message box at all when I do this (Firefox 3.5.3)

Confirmed: I am getting it in IE7...


Appears to be IE specific.

  • 7
    Surprise surprise.
    – GManNickG
    Oct 13, 2009 at 22:17

Confirmed: Windows XP in IE 7

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .