View Full Version : disable dragging link to address field

12-20-2006, 04:38 PM
Is there a way in IE and FF to disable the ability to drag links (and apparently any selected text in FF) to the address bar? I'm not in a position to change how the links are created but I could possibly modify some HTML or javascript property if such were available...

12-20-2006, 06:16 PM
You could do something like this:

<a href="#" onclick="location.replace(NEW LOCATION)">Link</a>

Then when you dragged the link into the address bar, it would point at '#'


This is horrible for accessibility, since a user with JS disabled will not be able to use the link


12-20-2006, 06:21 PM
Unfortunately, I don't have access to the code which generates the link, which already has javascript attached to the link. Although, I suppose I could do this in javascript by attaching an additional function to (all?) the link onclick.
I was hoping for some magic metadata tag in the header. I'll brood on this for a while...

12-20-2006, 06:30 PM
I was hoping for some magic metadata tag in the header.

The only way to do what you want is to mask the real link location from the browser. The feature that enables the user to drag the link to the address bar is from the browser, not the code.

That said, it is probably not a good idea to mess with the client's interface.