Navigate between three pages in two different files in JQuery Mobile

丶灬走出姿态 提交于 2019-12-04 17:11:54
Gajotres

Unfortunately this is not going to work. This is simply a downside of using multiple HTML template solution with jQuery Mobile.

Basically if you decide to work with multiple HTML pages only first HTML can have more then 1 page because that whole page will be loaded into the DOM.

If ajax is used to load pages (default page handling), when second html is loaded into the DOM only the first page is going to be loaded, every other pages including the page HEAD will be discarded.

You can do 2 things to fix this problem:

Solution 1

Let your third page be inside an another html, for example third.html.

Solution 2

Disable page loading with ajax. This will fully load second.html so you can switch to inner pages. Unfortunately you will lose page transitions.

In the end, if you want to find more take a look at my other answer: Why I have to put all the script to index.html in jquery mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!