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
- <html>
- <head>
- <title>jQuery Mobile page</title>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="themes/my-custom-theme.css" />
- <link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile.structure-1.4.2.min.css" />
- <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
- </head>
- <body>
- <!-- Start of page_a page -->
- <div data-role="page" id="page_a">
- <div data-role="header" data-position="inline">
- <a href="#nav-panel" data-icon="bars" data-iconpos="notext">Menu</a>
- </div><!-- /header -->
- <div data-role="content"><p>This is page_a.</p>
- </div><!-- /content -->
- <div data-role="panel" data-display="push" id="nav-panel">
- <ul data-role="listview">
- <li data-icon="delete"><a href="#" data-rel="close">Close Menu</a></li>
- <li><a href="#page_a">A</a></li>
- <li><a href="#page_b">B</a></li>
- <li><a href="#page_c">C</a></li>
- </ul>
- </div><!-- /panel -->
- </div><!-- /page_a end -->
- <!-- Start of page_b page -->
- <div data-role="page" id="page_b">
- <div data-role="header" data-position="inline">
- <a href="#nav-panel" data-icon="bars" data-iconpos="notext"></a>
- </div><!-- /header -->
- <div data-role="content"><p>This is page_b.</p>
- </div><!-- /content -->
- <div data-role="panel" data-display="push" id="nav-panel">
- <ul data-role="listview">
- <li data-icon="delete"><a href="#" data-rel="close">Close Menu</a></li>
- <li><a href="#page_a">A</a></li>
- <li><a href="#page_b">B</a></li>
- <li><a href="#page_c">C</a></li>
- </ul>
- </div><!-- /panel -->
- </div><!-- /page_b end -->
-
- <!-- Start of page_c page -->
- <div data-role="page" id="page_c">
- <div data-role="header" data-position="inline">
- <a href="#nav-panel" data-icon="bars" data-iconpos="notext"></a>
- </div><!-- /header -->
- <div data-role="content"><p>This is page_c.</p>
- </div><!-- /content -->
- <div data-role="panel" data-display="push" id="nav-panel">
- <ul data-role="listview">
- <li data-icon="delete"><a href="#" data-rel="close">Close Menu</a></li>
- <li><a href="#page_a">A</a></li>
- <li><a href="#page_b">B</a></li>
- <li><a href="#page_c">C</a></li>
- </ul>
- </div><!-- /panel -->
- </div><!-- /page_c end -->
- </body>
- </html>