I use the HTML 5 history api to maintain state when making ajax requests, and I provide full html content if the user request to the same page without any ajax request.
The function "Open last closed tab" of the browser brings the last content of the ajax request without getting to the server. If the browser will request without adding the last contents of the request, everything will work without problems. But the browser just shows the latest ajax request content.
I tested this on Chrome 17, Firefox 10. (I have not tried it on ie9 because it does not have api support history)
What is a well-known solution to this problem?
Edit: these ajax requests are just a get request to the server.
it is really impossible to demonstrate this in jsfiddle.net because there are few reasons. You can demonstrate this in your local host, as shown below.
Make a “get” request to the server and pull out the json objects, then click this url into the api history as shown below.
history.pushState(null,null,url);
Then close this tab and click "Reopen the last closed tab" in your browser. What do you see? Json response body? The browser shows this without a server request, does it?
source share