segmentfault 的回复是通过 question's url + #a-comment's id 来定位的。 比如我这条回复生成后,地址栏就自动变为了:http://segmentfault.com/q/1010000000471809#a-1020000000471847 //你可以点击上面这个链接试试,指向的就是我现在的回复 问题 url:http://segmentfault.com/q/1010000000471809 回复 id :1020000000471847 我觉得应该就是简单的 js 跳转,举例说明: <script> function jumpToMyComment() { window.location.hash='a-commentId'; } </script> <button onclick="jumpToMyComment()">submit</button> <div style="height:1000px"></div> <p id="a-commentId">My comment</p>
segmentfault
的回复是通过question's url + #a-comment's id
来定位的。比如我这条回复生成后,地址栏就自动变为了:
http://segmentfault.com/q/1010000000471809#a-1020000000471847
//你可以点击上面这个链接试试,指向的就是我现在的回复
问题
url
:http://segmentfault.com/q/1010000000471809回复
id
:1020000000471847我觉得应该就是简单的
js
跳转,举例说明: