jQuerry Mobile Panel Error

jQuerry Mobile Panel Error

I am implementing jquery mobile panel into my site. All works fine until I decide to visit the same page twice, then the panel icon (data-icon="bars") does not open the panel. It does not respond. It works when I manually reload the page. I believe it has sth to do with the cache or ajax :-( Please help. Recap: 1. I tap the panel icon & it opens side panel. I go from page_a to page_b. Next, I go back to page_a and try to go back to page_b again (data-icon="bars") does not respond any more. I need to manually reload the page and then it works. How to fix it please? Thank you


  1. <html>
  2. <head>
  3. <title>jQuery Mobile page</title>
  4.   <meta charset="utf-8" />
  5.   <meta name="viewport" content="width=device-width, initial-scale=1">
  6.   <link rel="stylesheet" href="themes/my-custom-theme.css" />
  7.   <link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
  8.   <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile.structure-1.4.2.min.css" /> 
  9.   <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> 
  10.   <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> 
  11. </head>
  12. <body>
  13. <!-- Start of page_a page -->
  14.     <div data-role="page" id="page_a">
  15.         <div data-role="header" data-position="inline">
  16.         <a href="#nav-panel" data-icon="bars" data-iconpos="notext">Menu</a>
  17.         </div><!-- /header -->
  18. <div data-role="content"><p>This is page_a.</p>
  19.         </div><!-- /content -->
  20.         <div data-role="panel" data-display="push" id="nav-panel">
  21.         <ul data-role="listview">
  22.             <li data-icon="delete"><a href="#" data-rel="close">Close Menu</a></li>
  23.                 <li><a href="#page_a">A</a></li>
  24.                 <li><a href="#page_b">B</a></li>
  25.                 <li><a href="#page_c">C</a></li>
  26.         </ul>
  27.     </div><!-- /panel -->
  28.     </div><!-- /page_a end -->

  29.     <!-- Start of page_b page -->
  30.     <div data-role="page" id="page_b">
  31.         <div data-role="header" data-position="inline">
  32.         <a href="#nav-panel" data-icon="bars" data-iconpos="notext"></a>
  33.         </div><!-- /header -->
  34.        <div data-role="content"><p>This is page_b.</p>
  35.         </div><!-- /content -->
  36.         <div data-role="panel" data-display="push" id="nav-panel">
  37.         <ul data-role="listview">
  38.             <li data-icon="delete"><a href="#" data-rel="close">Close Menu</a></li>
  39.                 <li><a href="#page_a">A</a></li>
  40.                 <li><a href="#page_b">B</a></li>
  41.                 <li><a href="#page_c">C</a></li>
  42.         </ul>
  43.     </div><!-- /panel -->
  44.     </div><!-- /page_b end -->
  45.    <!-- Start of page_c page -->
  46.     <div data-role="page" id="page_c">
  47.         <div data-role="header" data-position="inline">
  48.         <a href="#nav-panel" data-icon="bars" data-iconpos="notext"></a>
  49.         </div><!-- /header -->
  50.         <div data-role="content"><p>This is page_c.</p>
  51.         </div><!-- /content -->
  52.         <div data-role="panel" data-display="push" id="nav-panel">
  53.         <ul data-role="listview">
  54.             <li data-icon="delete"><a href="#" data-rel="close">Close Menu</a></li>
  55.                 <li><a href="#page_a">A</a></li>
  56.                 <li><a href="#page_b">B</a></li>
  57.                 <li><a href="#page_c">C</a></li>
  58.         </ul>
  59.     </div><!-- /panel -->
  60.     </div><!-- /page_c end -->
  61. </body>
  62. </html>