Hi (I may not be doing this correctly) - I am trying to and having problems navigating to a page in my JQuery Mobile (JQM) application when trying to load the page as a dialog using "changePage()". I have looked around and have tried a few alternatives with no luck :(
E.g. I have a login page that opens successfully as a dialog on the application init:
This seems unnecessarily complicated. I don't understand why you need to create the dialog dynamically.
Not sure if this is what is causing your problem, but it certainly will cause *a* problem. You have duplicated an element IDs, and that's not permitted in HTML. How browsers handle that is unpredictable.
When you call createPage() a second time, you are inserting a second page. Now you have two pages in the document both having the same IDs on all of the elements that have IDs.
Hi, thanks for the reply - I did not mention / include in the example, that I am cleaning the pages each time therefore no duplicate elements or ids are being added (only one page is added / rendered at any one time).
I think I have fixed the problem - not sure if its a "cosier" fix, but appears to work:
Before calling the changePage() method, I need to first initialize the new page: E.mobile.initializePage();
Leave a comment on ljonny18's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic