Su IE puoi usare onbeforeunload ..