Depends on how you load the relevant pages.
If you use rel = "external" - there is no AJAX, each page will be reloaded completely.
If you use regular JQM-AJAX, JQM will take the page and bind it to the existing DOM. Think of your first page as your "anchor" page, which all subsequent pages are added / removed.
In the second case, you can specify the data-append-all-pages = "true" attribute for the elements that you want to have on each page.
Then just listen to the corresponding event (pagebeforeshow?) And add the elements with the above label to the new page before it is shown. Thus, elements should only be installed on the first page, and then automatically added to any subsequent page that is retracted and added to the DOM.
I am studying this right now with a login form that I need on every page outside the login and should not end with duplicate # someID input.
EDIT - Possible Solution
Place the appropriate element on the first page and add unique attributes, for example:
<div data-role="navbar" data-unique="true" data-unique-id="log"> // full navbar </div>
All other pages just get a unique element container
<div data-role="navbar" data-unique="true" data-unique-id="log"></div>
Then use this script:
$('div:jqmData(role="page")').live('pagebeforehide', function(e, data) { // check page you are leaving for unique items $(this).find('div:jqmData(unique="true")').each(function(){ // more or less 1:1 stickyFooter var uniqueID = $(this).jqmData("unique-id"), nextPage = data.nextPage, nextUnique = nextPage && nextPage.find( "div:jqmData(unique-id='"+uniqueID+"')" ), nextMatches = nextUnique.length && nextUnique.jqmData('unique-id') === uniqueID; // if unique items on previous and new page are matching if ( uniqueID && nextMatches ) { nextUnique.replaceWith( uniqueID ); $(this).jqmData("unique-id").empty(); } }); });
Of course, this would mean that you need a unique container on each page. But then you just carry its contents when you go through the application. Should work for me and avoid using the same login form 2 times in the DOM.
In addition, you could freely edit its contents, for example, adding an active class.