0

In IE, if the window.onbeforeunload function returns a null, it will still pop up an alert window. How do I prevent this from happening?

Frank Tian
  • 787
  • 3
  • 8
  • 22
  • Don't return anything at all. Presumably, `return;` or `return undefined;` would work, but I usually just have it end the function without a `return` statement. – gen_Eric Mar 21 '14 at 20:40

1 Answers1

0

If it's anything (including a function that returns null) IE will still show the dialog.

In IE you have to clear the function entirely.

See this answer for more detail.

Community
  • 1
  • 1
Keith
  • 150,284
  • 78
  • 298
  • 434