I am trying to figure out how I can keep my page from linking to a new page when I click on a link from an IM or email, etc. For example, I am working on a web based applicaton and I click on a link to go to ESPN.com. It takes me to espn straight from the application and I lose unsaved work. Any ideas? I tried calling a function from the onunload event and have tried several different attempts at blocking the link including the following different ideas:
location.replace(location.href);
location.href=’myapp.html’
history.go(-1);
However, my code does nothing. I do popup an alert to show that my method is being called but after the alert I get directed to espn. If I can click back in time on the browser, I am okay so I thought the above segments would do the trick but they do nothing. Thanks for any help!!!
Dan