Steven
Steven

Reputation: 19425

Why isn't JQM loading my (multi) page?

I'm using jQuery Mobile for an hybrid app and I have 2 files with 3 pages.

File 1: Page A
File 2: Page B and C

If on page A I click the link to page B, the page loads.
If I then click the link to page C, it will not load. But if I reload page B using F5, I can click the link and page C is loaded.

I know the link registers the click action, because this code snippet works

    $('a.map').click(function(){ console.log('test');});

JQM just doesn't load the page.

This is my File 2:

<div id="mainPage" data-role="page">
  <a class="map right ui-corner-all" href="#storeMap" data-prefetch="true" data-transition="flip">Map</a>
</div>

<div id="storeMap" data-role="page"> (...) </div>

Does anyone know why this is happening?

Upvotes: 0

Views: 21

Answers (1)

Musa
Musa

Reputation: 97672

You cannot use ajax navigation for multi-page templates, only the first page will be used.
When linking to page B from page A use rel="external" in you anchor to disable the ajax loading.

Upvotes: 1

Related Questions