title: jQuery Mobile popup is not opening on .popup('open')
body: <p>I am trying to use jQuery Mobile 1.3.1's popup to warn the user when login credentials are false. I started with a basic template from jquerymobile's documentation, but I couldn't make it work with <code>$('#popupBasic').popup('open');</code> If I use it this way;</p>
  
  <pre><code>     &lt;div data-role="page"&gt;
  
  
          &lt;div data-role="header" data-tap-toggle="false"&gt;
          &lt;/div&gt;&lt;!-- /header --&gt;
  
          &lt;div data-role="content"&gt;
  
              &lt;a href="#popupBasic" data-rel="popup"&gt;Tooltip&lt;/a&gt;
              &lt;div data-role="popup" id="popupBasic"&gt;I will change this text dynamically if this popup works&lt;/div&gt;
  
  
          &lt;/div&gt;&lt;!-- /content --&gt;
      &lt;/div&gt;&lt;!-- /page --&gt;
  </code></pre>
  
  <p>It works well when I click on the Tooltip link. But in my case there isn't any click so I am trying this;</p>
  
  <pre><code>                if(retVal){
                      $.mobile.changePage('index');
                  }
                  else{                    
                      $('#popupBasic').popup();
                      $('#popupBasic').popup("open");
                  }
  </code></pre>
  
  <p>this is after my ajax login function makes a callback, so retVal is true if there isn't any errors, false if there is (and at that point I am trying to show popup). By the way all my js part is in </p>
  
  <pre><code> $(document).on('pageinit', function(){});
  </code></pre>
  
  <p>so i wait till jquerymobile is ready for the page.</p>
  
  <p>What happens when I do this is on desktop browsers link changes as </p>
  
  <pre><code>http://localhost/login#&amp;ui-state=dialog
  </code></pre>
  
  <p>but doesn't show the pop up. After some refreshes and caches it starts to show. On iOS same thing also happens but on android sometimes it changes link some time it doesn't.</p>
  
  <p>I would be really happy if someone can help me to solve this problem.
  Thanks in advance.</p>