title: JQuery-mobile. Can't open the dialog programmatically; tried everything I could think of
body: <p>I want to open a jquery-mobile dialog programmtically. I tried to do:</p>
  
  <pre><code>$("#jenia-dialog").dialog()
  #("jenia-dialog").dialog("open")
  Error: no such method 'open' for dialog widget instance
  </code></pre>
  
  <p>This is my html file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
      &lt;title&gt;Page Title&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.css" /&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div data-role="page"&gt;
      &lt;div data-role="header"&gt;
          &lt;h1&gt;Sample&lt;/h1&gt;
      &lt;/div&gt;
      &lt;div data-role="content"&gt;
          &lt;p&gt;&lt;/p&gt;
          &lt;p&gt;&lt;a href="dialog.html" data-rel="localhost/static/dialog" data-role="button"&gt;Is this a question?&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-role="page" data-url="dialog.html" id="dialog-jenia"&gt;
      &lt;div data-role="header"&gt;
          &lt;h1&gt;Dialog&lt;/h1&gt;
      &lt;/div&gt;
      &lt;div data-role="content"&gt;
          &lt;p&gt;Is this an answer?&lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my jsfiddle page: <a href="http://jsfiddle.net/kK24p/" rel="nofollow">http://jsfiddle.net/kK24p/</a></p>
  
  <p>All I want to do is open the dialog using js instead of the button.</p>
  
  <p>If someone could help me it would be great.</p>
  
  <p>Thanks a lot in advance.</p>