8

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

10

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!";
}
2

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

Confirmed: I am getting it in IE7...

1
1

Appears to be IE specific.

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

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 .