Navigate event not firimg
Hi,
I'm new with JQM and I do not understand the navigate event within multipage document. I want to navigate through the different pages and make ajax requests to a server to refresh some of the content. The page structure is like this:
- <div data-role="page" id="map-page">
- <div class="init">
- <h1>Map Page</h1>
- <ul>
- <li><a href="#list-page">Go to List</a></li>
- <li><a href="#picture-page">Take Picture</a></li>
- <li><a href="#details-page">Go to Details</a></li>
- </ul>
- </div>
- </div>
- <div data-role="page" id="list-page">
- <div class="init">
- <h1>List Page</h1>
- <ul>
- <li><a href="#map-page">Go to Map</a></li>
- <li><a href="#picture-page">Take Picture</a></li>
- <li><a href="#details-page">Go to Details</a></li>
- </ul>
- </div>
- </div>
if I try to capture the navigate event nothing happens when clicking on the links:
- $(window).on("navigate", self.onNavigate);
If I use the pagechange I can pick the events correctly
- $(window).on("pagechange", self.onNavigate2);
Is the navigate event only firing when navigating programatically? because if I call
- $.mobile.navigate("#map-page", {info: "aaa"});
the navigate event is fired.
It seems I'm not getting the explanations in the navigation section of the demos, can you hint me?
TIA.