Currently, the permalink to an answer works like this:

<a title="permalink to this answer"

I suggest to change it so that it becomes:

<a title="permalink to this answer"
 onclick="prompt('Permalink for this answer:', 'http://stackoverflow.com/questions/2121172/possible-reasons-for-tellg-failing/2121359#2121359'); return false;">link</a>

This will make the following dialog box appear with the text already selected if you have javascript enabled, so all you have to do is press ctrl-c and then Enter or Esc, instead of having to open a new page and then copy the URL from the address bar. Example:

example http://img231.imageshack.us/img231/8767/examplepermalink.png

If you have Firebug you can test it right away how it would look like! Just type in the console:

prompt('Permalink for this answer:', 'http://stackoverflow.com/questions/2121172/possible-reasons-for-tellg-failing/2121359#2121359');

Users without javascript enabled (not sure if this is supported at all) will experience the old exact behavior.

  • 5
    That would be incredibly annoying. – random Jan 27 '10 at 15:54
  • 1
    @random: Why? It's the least annoying way to provide the user with an easily ctrl-c'able text. – Thomas Bonini Jan 27 '10 at 15:54
  • 8
    Right-click and Copy link Address. Ever tried that? – random Jan 27 '10 at 15:59
  • And that is less annoying because..? My solution is much better because it's faster, easier, and last but most importantly because inexperienced users don't know that they can copy the link's address. Right-click, view source, find the id of the question and of the answer, and then construct the link from them works too. It doesn't mean it's the best solution. – Thomas Bonini Jan 27 '10 at 16:00
  • 2
    If anything, I'd rather it automatically copy the whole link to the clipboard for me. – Jon Seigel Jan 27 '10 at 16:01
  • @Jon: browsers offer no way to do it for security reasons – Thomas Bonini Jan 27 '10 at 16:02
  • @Koper: They used to... I guess my JS is rusty. Okay, then, I'm all out of ideas. – Jon Seigel Jan 27 '10 at 16:05
  • 1
    That would be great. It's such a big pain to have to go to the new window, select the text in the address bar, and hit ctrl-c (or mouse-copy it), then close the window, and go back to the window you were in. – Lance Roberts Jan 27 '10 at 16:06
  • 4
    As someone who actually uses the "link" link as a link, I am going to downvote you fifty times (in my head). – Welbog Jan 27 '10 at 16:08
  • @Jon: IE still does (I think), but it's the only major browser that allows that (again, 99% sure not 100%). But IE is not really known for its security :). @Jean: you can still use it as a link, just middle-click it. – Thomas Bonini Jan 27 '10 at 16:08
  • Why would you use the "link" link as a link, when you're already at the destination? – Lance Roberts Jan 27 '10 at 16:14
  • 1
    Because I'm not necessarily at the destination. I might have come to the page from an answer and want to have the question's URL properly in the address bar, or I want to refresh the page and my mouse is already near one of those links. Those are the most common reasons I do it. – Welbog Jan 27 '10 at 16:20
  • 5
    Holy christ, no. – GEOCHET Jan 27 '10 at 17:31
  • 1
    This was implemented after someone brought up the same point on ux.se: ui.stackexchange.com/q/4287 – Patrick McElhaney Apr 4 '11 at 14:36

Uh... If you really wanted to do something fancy, you could simply create a HTML input field, populate it with the URL, and select it. At least this wouldn't result in a modal dialog standing in your way and prompting you with two buttons that look different but do the same thing...

But that would be pointless. Because right now, even today, if you click that link your browser will navigate to the resulting URL. And you can then copy the "permalink" out of your address bar (which probably already selects the whole thing when you click in it), or bookmark it, or hit File->Send Link, or print out 20 copies and make a suit of clothes from the resulting inky paper... just like you would do for every other URL.

And if you're a "power user" who knows all the "secret browser tricks they don't teach you in browser school" you can "right click" on the "link" with your "mouse" and simply copy the URL that way. Just like you would do for every other link to everything, everywhere.

I do not think it is a good idea to abandon common practices based only on a suspicion that someone, somewhere, is using The World-Wide Web for the very first time and must therefore be accommodated at the expense of everyone else.

|improve this answer|||||

Who opens a new page and copies the address? I right-click the link and choose "Copy shortcut" or "Copy link address". That's faster even than a javscript popup.

|improve this answer|||||
  • Yes but like I said above inexperienced users don't know about this feature. Additionally the popup is faster to use, and you can still use it as a normal link if you want (for what reason?), just middle click it. – Thomas Bonini Jan 27 '10 at 16:10
  • 3
    @Koper - the vast majority of users of stackoverflow are not "inexperienced users" of their browser. My hunch is that this'll annoy far more people than it'll help. Also, I've never ever seen a site do as you suggest for people - so most people are likely to expect permalinks to be links. – Dominic Rodger Jan 27 '10 at 16:13
  • @Dominic: there is not only stackoverflow. Many of the users on superuser are inexperienced, for example. – Thomas Bonini Jan 27 '10 at 16:13
  • @Koper - true, but "Super User is for computer enthusiasts and power users", not for inexperienced users (superuser.com/faq) - if a given user doesn't know how to use their browser, I'd struggle to see how they fit into that demographic. – Dominic Rodger Jan 27 '10 at 16:15
  • 2
    @Dominic: while I agree that we shouldn't do this, the vast majority of questions I see on SU are coming from people who would fit Koper's description... The "SuperUsers" are the ones answering the questions for the inexperienced who go there asking questions. – squillman Jan 27 '10 at 16:18
  • @squillman - interesting. Must confess I've not spent any time on superuser.com, so I was just going by the faq. Wonder if the faq should be adapted to more closely match the way the site is being used... – Dominic Rodger Jan 27 '10 at 16:31
  • Granted: I've been using my new ipod touch a lot lately, and opening the page to copy the link is the only option there. Plus, it renders pages very slowly, so this can be kind of painful. – Joel Coehoorn Feb 13 '10 at 21:44
  • @ShadowWizard I understand the reason behind rejecting my edit as it was a minor change and don't wanted to bump(not my intention either) the 5.7 years old question on the front-page. BUT, it's annoying to leave the "javscript" word unchanged. What if the Joel Coehoorn (with over 280K reps combined SE profiles) corrects the misspelled word? Would that also be rejected? Or is there something e.g. high reps can edit minor/misspelled words without bumping the post? – HackerKarma Jul 9 '15 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .