I have a problem. I bind click events to my "a" tags which hides the contents of the page and shows a loading spinner (until the new page has loaded).
The problem of this approach is that when you click the back button of the browser, the browser recovers the last state of the previous page, where you can only see the loading spinner.
It isn't the same for every browser, but for example on an iPad with the latest Safari this is a problem.
An example of how my code looks like is this:
$("a").click(function() {
showLoadingSpinner(".container", "loading new page...");
// hides the div with the container class and
// shows the loading spinner with the text "loading new page..."
});
Maybe I have to somehow replace all of these requests with some kind of ajax request where I can hide the loading spinner after the request has been completed?
Edit: I am using ASP.net to build the website (no PHP). It's a really complicated and big application with lots of different types of ajax requests everywhere on the page.
Edit 2: Just to clarify, I'm talking about "a" tags with "href" attributes.