Pages

Wednesday, October 7, 2009

Multi-Hyperlinks

OK, as always, I have no idea whether someone has already thought of this or patented the idea, but here is an idea for making one <a> tag refer to multiple different URLs and having those choices show up in a menu when right-clicking the link.

There are two different approaches to doing this:

  • Multiple additional attributes in the <a> tag itself.
    • Unfortunately, attribute names must be unique so something would have to create the new attributes and make sure that no names were replicated. This would require additional code in an HTML editor or extra work on the part of the web designer.
  • Inserting a sequence of additional elements within the content of the <a> tag.
    • Those elements would be empty content tags that only contain a href= attribute for the additional hyperlink.
    • It appears (after cursory experimentation) that empty <a> tags could be used.

Then all that would be needed is a plug-in for the browser to insert these hyperlinks into the context menu when a user right-clicked on the link. Eventually, this functionality could be incorporated into all browsers, eliminating the need for the plug-in. For those whose browser does not have this functionality, the primary href in the enclosing <a> tag will still work when left-clicked.

Test Link

The contents of this post is Copyright © 2009 by Grant Sheridan Robertson.
However, the idea (if it does not already belong to someone else) is hereby declared to be in the public domain. Anyone can use this idea for any purpose.

No comments:

Post a Comment