I am trying to implement something similar to a functionality on Stack Overflow.
On a user's profile page, where there are listed the Answers by user, when you click on the link to question, you are redirected to the question page and the answer is highlighted.
This works even if the answer clicked on happens to be lying on like 2nd page below, the page is displayed.
How can I implement this? The only way I can think of right now is by implementing the following steps:
When listing the answers by a user..
- Find out the list of answers to every question the user has answered
- Sort the list
- Find out where the answer by user lies in that list
- This number can be to create a link to the page where answer by the user lies on question page
But this seems very memory-consuming process. Is there an easier way to do this?