3 ms·
How does HN know where in the page to bring you back to after you submit a comment?
by hanniabu 6y ago
How does HN know where in the page to bring you back to after you submit a comment?
- shakna 6y agoThe comment ID that you're replying to is included in the reply button. For example, yours looks like: reply?id=25277197&goto=item%3Fid%3D25276193%2325277197 Note the id element. Then, notice that the span that appears immediately before your comment has an ID too: unv_25277197. With those two pieces, adding a URI fragment is enough to get back to the right place.