title: not able to open dialog in jquery moblie
body: <p>I am unable to open a dialog if it exist on the same page. </p>
  
  <p>I tried it with: </p>
  
  <p><code>$("#addDialog").dialog('open');</code></p>
  
  <p>Then I tried it with an click event on the button <code>$("#openAddDlg")</code></p>
  
  <pre><code>  $.mobile.changePage('#addDialog', {
        transition: 'pop',
        changeHash: true,
        role: 'dialog'
    });
  </code></pre>
  
  <p>It works when I refresh the page, but if this page loads from another page then it won't work. I don't know what causes this. </p>
  
  <p>Page code: </p>
  
  <pre><code>&lt;div data-role="page" id="users"&gt;
  
      &lt;div data-role="header"&gt;
  
          &lt;h1 id="userheader"&gt;IM Messenger&lt;/h1&gt;
  
  
          &lt;a href="#" class="ui-btn-right" id="logout"&gt;Logout&lt;/a&gt;
  
  
      &lt;/div&gt;&lt;!-- /header --&gt;
  
      &lt;div data-role="content"&gt;
  
      &lt;center&gt;
          &lt;div data-role="navbar"&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="#"&gt;Peer&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;Group&lt;/a&gt;&lt;/li&gt;
  
                  &lt;/ul&gt;
              &lt;/div&gt;&lt;!-- /navbar --&gt;
  
  
  
      &lt;/center&gt;
      &lt;/div&gt;&lt;!-- /content --&gt;
  
  
  
      &lt;div data-role="footer"&gt;
          &lt;a href="#" id="openAddDlg" data-role="button" data-rel="dialog"&gt;Add Contact&lt;/a&gt;
      &lt;/div&gt;&lt;!-- /footer --&gt;
  
  
  
  &lt;/div&gt;&lt;!-- /page --&gt;
  
  &lt;div data-role="dialog" id="addDialog"&gt;
        &lt;div data-role="header"&gt;
          &lt;h1&gt;Send Invitation&lt;/h1&gt;
        &lt;/div&gt;
  
        &lt;div data-role="content"&gt;
  
          &lt;label for="username"&gt;JID:&lt;/label&gt;
          &lt;input type="text" name="addjid" id="im-addjid" value="user4@rewire.in"  /&gt;
  
          &lt;label for="username"&gt;Name:&lt;/label&gt;
          &lt;input type="text" name="addname"  id="im-addname" value="user4"  /&gt;
  
          &lt;a href="#" id="sendInvitation" data-role="button" data-theme="a"&gt;Send&lt;/a&gt;
  
        &lt;/div&gt;
  
  
  &lt;/div&gt; &lt;!-- dialog add contact --&gt;
  </code></pre>