File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Remove anchor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Remove anchor" Watch "Remove anchor" New topic

Remove anchor

Anu Jv

Joined: Apr 02, 2003
Posts: 14

I have anchored a link. Once the link is clicked the request goes to the server. During this time, if we click the link, data gets saved multiple times. I need to avoid this duplication. Is there any possibility to remove the anchor from the link once it is clicked to plain text using Javascript?

Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Ok, if you want a simple thing, than pick one of those:



there is 2 problems related to that:
1. Your page might have more than one link on it.
2. If you disabled a link, and user pressed "Stop", the link is disabled, and page is not reloaded.

So, in my code I used more generic approach - after link is clicked, I open a transparent DIV on top of the page. Here is the code I used. It was ment for IE 5.5+, but it should be very simple to port the code for any browser that supports DOM.

Note "spacer.gif" mentioned in the code below is 1px transparent image

[ May 20, 2004: Message edited by: Yuriy Fuksenko ]
I agree. Here's the link:
subject: Remove anchor
It's not a secret anymore!