I'll admit that I don't know how your pages are constructed, and it might not even be possible to fix this problem. However, recently we had an issue where a user was unable to use his userpage because his javascript failed to load properly.
Now, I can understand that in the case of failure on the user's end it is not longer the responsibility of SO to guarantee user experience; however if we look at the cause for poor user experience (in this case) it was because the buttons for question sorting link to the api instead of the page.
These buttons' "click" behavior is overridden to produce the correct ajax call, but in the case of javascript failing to load, or the user right-clicking and selecting open in new tab
, the user is redirected to the api directly instead of back to the same page with different sorting.
Steps to reproduce:
- Open up any user page
- Select the
stats
tab - Right click on
recent
and selectopen in new tab
- Notice how the user is directed to:
https://meta.stackoverflow.com/api/userquestions.html?userid=137041&page=1&pagesize=10&sort=recent
Expected Behavior: the user should be directed to https://meta.stackoverflow.com/users/137041/tzenes#qpage_1-apage_1-qsort_views-asort_votes
If we look at the javascript in question:
function loadAnswers(b, a) {
loadUrl("/api/useranswers.html?pagesize=" + answersPageSize + "&userId=" + userId, "#answers-table", b, a)
}
we see that url for the ajax call is hard coded and thus does not need to be on the <a>
tag. This seems to imply this can be easily fixed, but as I said there is no guarantee that page is constructed in such a way it can be fixed.
While SO cannot guarantee user experience in the case of failure, I think they can still improve the user experience with this change, providing some level of disaster recovery.
Open in New Tab
produces a fragment instead of the correct page.