I would like to use the HTML5 window.history feature to implement full AJAX navigation on my website. I have found a demo which shows an implementation of window.history whereby some content is passed to the history which can be called back and displayed in a textarea. I would like to follow and extend that approach by:
- changing the entire page content using AJAX when clicking on links.
- before loading new content, save the entire content of the page in history against the current URL.
- load the new content, change the URL, and save new content to history.
That way, when a user presses the previous and next browser buttons, the page content will be updated accordingly without ever triggering an HTTP request, giving the user a very smooth AJAX-based experience.
Q: Can you foresee potential issues with using such an approach? (I'm notably thinking about browser memory as I save entire pages to the history)