I have a single html page that I'm using jquery mobile on to create a web app with multiple divs with the data-role="page" attribute. Each page has a fixed header and footer that remains consistent through page transitions.
However, I want to load another html page not built in the jquery-mobile framework but in the same directory into the DOM and have the persistent, fixed header and footer appear over that page.
Is this possible? I've looked at the jquery Mobile documentation for using $mobile.changePage() and $mobile.loadPage() and am not really clear on how to implement it.
Thus far I have this (edited per @Jack's instructions):
HTML
<div data-role="page" id="dog_bars">
<div data-role="header" data-position="fixed" data-id="dog_header" class="custom_dog_header">
<h1>Dog About Town</h1>
</div>
<div data-role="content">
<ul data-role="listview" data-filter="true">
<li data-icon="home"><a href="#external_page" data-transition="slide" id="external_link">
<h2>303 Bar & Grill</h2>
<p>303 W. Davis St., Dallas</p>
</a></li>
</ul>
</div>
<div data-role="footer" data-id="bestFooter" data-position="fixed">
<nav data-role="navbar">
<ul>
<li><a href="#home" data-transition="slide" data-role="button" data-icon="home">Home</a></li>
<li><a href="#about" data-transition="slide" data-role="button" data-icon="gear">About</a></li>
</ul>
</nav>
</div><!-- end footer -->
</div>
<!-- page to be loaded into -->
<div data-role="page" class="content_page" id="external_page">
<div data-role="header" data-position="fixed" data-id="dog_header" class="custom_dog_header">
<h1>Casual Dining</h1>
</div><!-- end header -->
<section data-role="content" class="content" id="external">
</section>
<div data-role="footer" data-id="bestFooter" data-position="fixed">
<nav data-role="navbar">
<ul>
<li><a href="#home" data-transition="slide" data-role="button" data-icon="home">Home</a></li>
<li><a href="#dog_casual" data-transition="slide" data-role="button" data-icon="back">Back</a></li>
<li><a href="#about" data-transition="slide" data-role="button" data-icon="gear">About</a></li>
</ul>
</nav>
</div><!-- end footer -->
</div><!--end page-->
Jquery
$(document).on('pageinit'(function() {
$("#external").load("external_page.html").trigger("create");
}));
Currently, clicking on the link loads the #external_page just fine with the header and footer, but the content of external_page.html does not load. The section of #external_page is still empty.
Thoughts?