title: How to open a jQuery Mobile popup programmatically and close it after 5 seconds
body: <p>I want to open a jQuery Mobile popup programmatically and then close it after some seconds, here is my code :</p>
  
  <p>is there anything wrong, cause I'm not getting what I want to show</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$( "#p" ).popup( "open" ); 
  setTimeout( function(){ $( "#p" ).popup( "close" ); }, 5000 );</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"&gt;&lt;/script&gt;
  
  &lt;div data-role="popup" id="p" data-position-to="window" data-transition="turn"&gt;&lt;p&gt;This is a completely basic popup, no options set.&lt;/p&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="http://jsfiddle.net/genius50/m3kkpLtj/" rel="nofollow noreferrer">JSFIDDLE DEMO</a></p>