Why don't websites that use AJAX save the state of where you were when you click on a link and then use the back button?
-
When I am browsing Facebook or Quora heavily, I frequently use the 'more' button. But when I click away and then use the back button, I have to repeatedly click on more before I can get back to where I was browsing. Is this technically difficult to change?
-
Answer:
In the case of Quora and Facebook, I'm pretty sure the additional content you are able to reveal with the "more" button is already loaded, so clicking that button is really just firing off the ajax that unhides the hidden extra content. That interaction is done by javascript on the client side rather than on Facebook's servers, so it's not saved on their end and moreover the browser doesn't remember that interaction. When you hit the back button, it will reload that page with all the additional content hidden. It isn't impossible to fix, though. Those actions could add a series of identifiers to the URL to the right of a hash tag, and the javascript could interpret those id's and automatically reveal the content you had clicked "more" for when you navigate back to that page. Moreover, now that modern browsers are able to store more data in the browser itself, the click history could be stored and recalled on demand to make sure ajax driven states are preserved. At any rate, the folks at Quora and Facebook have more than enough expertise to pull this off, but it's my guess that it's not that big of a priority for them yet. Good question, btw!
Mark Nutter at Quora Visit the source
Other answers
Suppose there are 10 snippets on a page which can be expanded individually, that gives you 2^10 possible states that you would have to encode in a URL -- probably in the hash portion so that a page load is not triggered. Then you would need Javascript logic to decode the hash portion, and map it to expanded/collapsed states on a specific set of snippets. Last you would need to be able to apply this logic anytime the hashchange event was fired. None of this is technically challenging. Probably the holdup here is that hashchange is only supported in current generation browsers, and in older browsers you need to periodically poll window.location.hash to detect changes. That's not a bad approach -- if you absolutely need that functionality you can do it that way, but high-frequency polling is a hack. More information on hashchange: https://developer.mozilla.org/en/DOM/window.onhashchange
Jesse Dhillon
Related Q & A:
- Why don't I get the little envelope in my taskbar in Outlook Express when I get a message?Best solution by Yahoo! Answers
- Why don't people care about the earth?Best solution by Yahoo! Answers
- Why don't I have an information bar?Best solution by Yahoo! Answers
- Is there a job/carrier that don't require the use of computers?Best solution by Yahoo! Answers
- Why don't we use E-Prime more?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.