JQM (jQueryMobile) Access to URL history? Ability to move to any location in the history hash

JQM (jQueryMobile) Access to URL history? Ability to move to any location in the history hash

I have a issue with being able to link back to the home page from a AJAX response from a Multi-page layout form submission

The structure

`index.php` has multi-page agreement (`index.php#agreement`) 

`#agreemen`t has a form that is using the default AJAX call for submission to (`agreement.php`)

From agreement.php I can go back to the last page (`#agreement`) which is expected but now I wanted to go back to the `index.php` page. 

I can easily put `href="index.php"` but then the session looses it values.

Is there a way to go back two steps? or access the URL history and point to a specific page without loosing any of the data in the form(s)?

I have binded `agreement.php` using this code in `index.php` 

  1.     $('#agreement_status').live('pageshow',function(event, ui){
  2.         // Button action
  3.         $('#back_home').click(function(){
  4.             window.history.back(); // this goes back one page to index.php#agreement
  5.             window.history.back(-2); // this goes back one page to index.php#agreement
  6.             $.mobile.changePage("#index", "slideup"); // this works but appends the hashtag in the URL which breaks the other functionality 
  7.         });
  8.     });

In agreement.php I have this code

  1.     <a id="back_home" 
  2.        data-role="button" 
  3.        data-icon="home" 
  4.        data-theme="z" 
  5.        data-inline="true" 
  6.        style="float:right;">
  7.         Home
  8.     </a>