title: JQueryMobile popup not showing when appending hash to URL
body: <p>I am trying to open a jQuery DateBox popup in my page which modifies the hash of the window so the back browser button closes the popup instead of going to the previous website in the browser history.</p>
  
  <pre><code>&lt;div data-role="page" id="base-layout"&gt;
      &lt;div data-role="content" id="my-content-layout"&gt;
          &lt;div id="divDesde"&gt;
              &lt;label for="divDesde" style="text-align: left;"&gt;From Date:&lt;/label&gt;
              &lt;input data-theme="c" name="fechaDesde" id="fechaDesde" type="text" data-role="datebox" data-options='{"enablePopup": true, "useNewStyle":true, "centerHoriz": true, "centerVert": true, "mode":"datebox", "overrideDateFormat": "%d/%m/%Y"}' value="" class="required" required="required" /&gt;
          &lt;/div&gt;
          &lt;div id="divHasta" class="desdeHastaDiv"&gt;
              &lt;label for="fechaHasta" style="text-align: left;"&gt;To Date:&lt;/label&gt;
              &lt;input data-theme="c" name="fechaHasta" id="fechaHasta" type="text" data-role="datebox" data-options='{"enablePopup": true,"useNewStyle":true, "centerHoriz": true, "centerVert": true, "mode":"datebox", "overrideDateFormat": "%d/%m/%Y"}' value="" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;script&gt;
      $(document).on("pageinit", "#base-layout", function() {
  
          $('#fechaHasta').on('datebox', function(e, p) {
              if (p.method === 'open') {
                  window.location.hash = "#fechaHasta";
              }
              if (p.method === 'close') {
                  window.location.hash = '';
              }
  
          });
          $('#fechaDesde').on('datebox', function(e, p) {
              if (p.method === 'open') {
                  window.location.hash = "#fechaDesde";
              }
              if (p.method === 'close') {
                  window.location.hash = ''
              }
  
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The problem is -- modifying the hash seems to somehow screw with the popup and it doesn't open the first time you click. Actually it does open but gets automatically closed as soon as the hash is appended.</p>
  
  <p>I've created a fiddle <a href="http://jsfiddle.net/kelmer/WUhwV/1/embedded/result/" rel="nofollow">here</a> although I can't see the hash; i guess it's not being shown because of jsFiddle layer over the page. You can click back on your browser to close the popup though. If you click on the calendar icon on the input, the first time it's not shown, if you click again it is.</p>