I have some web application at say http://www.somewebsite.com, when user refreshes the page, I want it to navigate to say http://www.google.com or anything else.
What I tried was attach event
window.onunload = function(){...}
and
window.beforeunload = function(){...}
I tried
window.location = "http://google.com"
for some reason it is not working.
Anybody has idea how to solve this problem?
Thanks in advance.
It CANNOT be done. The browser does not allow change of window url inside onunload or onbeforeunload. So, anybody else who is trying to do the same dont waste your time.