I am making a mobile version of an existing site using a mobile request. The site has hundreds of pages with markup installed, which works great for the www version. The problem is that on every page there are many instances of the same element identifier, for example, #useername or #map or #photo. This is normal on www, as each page loads independently, so there is no conflict. In JQM, it seems that all pages are somehow cached together, and the code refers to the previous page. For instance:
page1.html
<div id="commonIdOnEveryPage">Page 1</div> <a href="page2.html">Link</a> <script> alert($("#commonIdOnEveryPage").html()); </script>
Page2.html
<div id="commonIdOnEveryPage">Page 2</div> <script> alert($("#commonIdOnEveryPage").html()); </script>
After clicking the link from page 1 to go to page 2, the warning still shows βPage 1β.
In this example, it would be easy to change the identifier on the 2nd page, but on the site itself there are hundreds of places on different pages where the same identifier is used, and JS has thousands of lines. Of course, there is a way to make JQM compatible with this.
source share