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`
- $('#agreement_status').live('pageshow',function(event, ui){
- // Button action
- $('#back_home').click(function(){
- window.history.back(); // this goes back one page to index.php#agreement
- window.history.back(-2); // this goes back one page to index.php#agreement
- $.mobile.changePage("#index", "slideup"); // this works but appends the hashtag in the URL which breaks the other functionality
- });
- });
In agreement.php I have this code
- <a id="back_home"
- data-role="button"
- data-icon="home"
- data-theme="z"
- data-inline="true"
- style="float:right;">
- Home
- </a>