I have a basic jQuery Mobile page like so:
<div data-role="page" id="home">
</div>
<div data-role="page" id="products">
</div>
All works as expected unless I want to link to the products page from an external link. I’ve tried:
mysite.com/mobile/default.aspx#products but that only displays the home page. Is there a way for an external link to make the products page to show?
The short answer is that you cannot directly link to a specific page within a multipage document.
Unfortunately the way jQuery Mobile works is that when you link to a page with multiple “pages” it will by default only load the first page, to load the entire external multipage doc you need to either load the page without ajax (for example adding
rel="external", or if you want to load the page with ajax you can use the subpages plugin.As far as linking goes you should either separate your pages, or preload the external multipage document via ajax (using the plugin I linked to above, or manually if you are so inclined) and then link to it as an internal page.
From the Documentation