
This is the flowchart of my application. It is just one html file with all the pages.
When I try to go from page4 to page2 using
$.mobile.changePage( "#page2")
it shows me page2 and then immediately jumps to page1, but if I go to page1 and then go to page2 by changing url in browsers urlbar (index.html#page2) everything works correctly. This happens for any page I try to navigate this way from page4. What could be the problem?
I ended up splitting my app into different html files. Now everything works.