Click to See Complete Forum and Search --> : Protect page from links


RebelPark
07-14-2003, 05:11 PM
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

RebelPark
07-15-2003, 08:10 AM
Also, does anyone know how I can edit my profile settings?

Long time reader, first time poster.

jrlaughlin
07-15-2003, 09:56 AM
Can you not just set the target of the link to open in a new window?

Like this.

<a href="http://espn.go.com" target="newWindow">ESPN</a>

DaveSW
07-15-2003, 03:54 PM
Originally posted by RebelPark
Also, does anyone know how I can edit my profile settings?

Long time reader, first time poster.

try the 'user cp' button under web developer news at the top of the page.