I looked into the problem of Posting, Redirect and Back Button, using JQuery Mobile RC1 and Asp.Net MVC3 (I believe the problem happens with any other server technology).
JQuery Mobile has a mechanism to prevent the same page from being loaded twice for self-submitting forms.
I believe this was implemented in an incomplete way, because it doesn't take into account the data-url in the response page
Many CRUD web application will post the form back to the same URL, and let the server decide where to redirect (Post/Redirect/Get Design Pattern)
-It can be the same page if there are any validation errors with the submitted form
-It can be any other page
This redirect can happen on the server side, or with a 302 HTTP Header, this is not relevant for JQuery Mobile because JQuery Ajax method takes care of any HTTP redirections and returns the final page
Because this redirection is done server side, the destination page always has to have a data-url defined, so that the browser will show the correct URL.
With an example where we have Page1 and Page2, Page1 has a form with an action pointing to itself, the result of the post may be Page1 or Page2:
-On submit JQuery Mobile currently clears Page1 from the DOM, no matter what the destination data-url is.
-This is incorrect, it should only do this after getting the response from the post, based on the data-url (if existant) at the destination page, if the data-url is the same then it should clear the duplicate from the DOM.
The way it works now there are a couple of problems:
-When self posting to the same URL, and redirecting to a different page server side (using a data-url on the destination page) the back button on the second page will end in a blank page
-This happens only when the first page was loaded with an HTTP Get
-When posting to a different url, and redirecting to the same url as the first page (using a data-url) we end up with repeated pages on the DOM and the back button has to be pressed twice to return to the first page.