When I want to reference a previous answer on the same question's page, I normally click the answer's share link and copy the entire URL and use it in my comment or answer.
However, when this link is clicked, the page is reloaded...
This URL is different from the question's URL and currently, by inspecting, we know that each answer has an id="answer-ANSWER_ID"
. Therefore if we use the #
reference in this way:
https://stackoverflow.com/questions/**QUESTION-ID**/**QUESTION-TITLE**#answer-**ANSWER_id**
The browser just scrolls to that ID (without reloading). Is this OK to do? Or will these IDs change in the future?... Or is it simply bad in terms of SEO (if the question's title is changed, or due to other reasons)?
P.S.: Related to these, using comments id
s is acceptable as well?
P.P.S: It'd be useful to reference titles in really long answers, i.e., if each <h2>
would have an auto-assigned id, we would be able to do so...
id
in the question's URL?id
s), so I assume these won't be changed in the future, right?id
in the URL's link (e.g.#answer-ANSWER_id
). By your comment, I am not sure if you were trying to know that... However, in the comments of the answer below (which you linked), someone previously mentioned that theseid
URLs may not work in questions where there is pagination due to the large amount of answers. So it's better to avoid using them.