Changing window.location.href in Firefox in response to an onunload event
问题 I have a strange JavaScript problem using window.location.href, which apparently only affects Firefox (I'm using 3.6). Normally window.location.href would not be read-only, and this works perfectly in FF: window.location.href = "http://google.com/"; However, when I call a function in response to an onunload event (), this doesn't work as expected: function testThis() { alert ("1: " + window.location.href); window.location.href = "http://google.com/"; alert ("2: " + window.location.href);