3

Please help,

jquery mobile multipage wont work when a page is called from another page. It only displays the buttons but doesnt navigate to its internal pages when clicked. It works fine when the page is access directly.

<!-- Page 1-->
<div data-role="page" id="description" data-title="Description">
<div data-role="header"  data-position="fixed" data-theme="d">
<!-- header 1-->`enter code here`
</div>  
</div>
<div data-role="content">
<!--- content 1-->
</div>
<div data-role="footer"  data-position="fixed" data-theme="d">
<div data-role="navbar"  data-iconpos="bottom">
<ul>
<li><a href="#description" data-role="button" data-icon="star">Description</a></li>
<li><a href="#physicians" data-role="button" data-icon="star">Physicians</a></li>
</ul>
</div>
</div>
</div>

<!-- Page 2-->
<div id="Physicians" data-role="page" data-title="Physicians">
<div data-role="header"  data-position="fixed" data-theme="d">
<!-- header 2 -->
</div>
<div data-role="content">
<!-- content 2 -->
</div>
<div data-role="footer"  data-position="fixed" data-theme="d">
<div data-role="navbar"  data-iconpos="bottom">
<ul>
<li><a href="#description" data-role="button" data-icon="star" data-transition="pop">Description</a></li>
<li><a href="#physicians" data-role="button" data-icon="star" data-transition="pop">Physicians</a></li>
</ul>
</div>
</div>
</div>
Jayden
  • 45
  • 1
  • 8

3 Answers3

2

Try adding to the anchor the attribute rel="external".

Example:

<a href="#description" data-role="button" data-icon="star" rel="external">Description</a>
Littm
  • 4,923
  • 4
  • 30
  • 38
geralOE
  • 484
  • 4
  • 7
1

try giving <div data-role="page" first for your second page

uday
  • 8,544
  • 4
  • 30
  • 54
0

When you call this page from another page, it ONLY loads the div[data-role="page"] of that page, not the other div in this multi-page file!

Actually to be precise, when you link to a page from another page, ONLY the code inside the div you are targeting is pulled in via AJAX, even if you had JS in the <head> that won't get loaded either.

Try linking to this page with an external link and you'll find it works fine.

Clarence Liu
  • 3,874
  • 2
  • 25
  • 29
  • No, The page is not loaded from another page. what i mean the page is clicked from another page. And i don't have other js file aside from the jquery mobile. – Jayden Feb 07 '12 at 14:49
  • example i have a multipage : multipage.html The multipage functionality works fine when you browse the file directly. But if you have a page like: home.html and it has a link to multipage.html the multipage functionality of multipage.html doesnt work. If you refresh the page, it will work again. – Jayden Feb 07 '12 at 15:03
  • Try data-ajax="false" on your a href= to your page My Link – imaginethepoet Feb 10 '12 at 04:47