title: JQuery Mobile changePage
body: <p>I am designing a JQuery Mobile application and facing one problem there,
  I have two pages, <code>page1.aspx</code> and <code>page2.aspx</code>, I have to redirect from <code>page1</code> to <code>page2</code>. Currently I am using <code>window.location.href</code> for redirection, but it is show loading also in address bar.</p>
  
  <p>In order to avoid this I want to use <code>$.mobile.changePage</code>.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>Now before redirection I am setting one value in <code>localStorage</code> variable, based on this value on load event of <code>page2.aspx</code> I have to bind the page. It's working fine with <code>window.location.href</code>, but while using <code>$.mobile.changePage</code> it is redirecting but load event is not firing after coming to <code>page2.aspx</code> if I am refreshing the page it is loading.
  So my problem is while displaying <code>page2.aspx</code> load event has to fire.</p>
  
  <p>Can anyone tell me why <code>page2.aspx</code> is not loading while using <code>$.mobile.changePage</code>?</p>
  
  <p>If anyone knows the solution, please reply ASAP, its very urgent.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Page1.aspx:</strong></p>
  
  <pre><code>localStorage.setItem("pageCode", "NULLException");
  //$.mobile.changePage("../MessageDialog.aspx", "slide", true, true);
  $.mobile.changePage("../MessageDialog.aspx", { transition: "slide", changeHash: true, reverse: false }); 
  </code></pre>
  
  <p><strong>Page2.aspx:</strong></p>
  
  <pre><code> $('div').live("pageshow", function () {
       if (localStorage.getItem("pageCode") != null) {
           if (localStorage.getItem("pageCode") == "NullException") {
                      $('#lblDialogHeader').text("Error");
                      $('#lblDialogMessage').text("Sorry");
                      document.getElementById("btnOK").setAttribute("onclick", 'Test()');
                  }
      }
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div data-theme="c" data-role="page" id="test"&gt;
          &lt;div data-role="header" data-theme="b"&gt;
              &lt;h1&gt;&lt;label id="lblStatus"&gt;Status&lt;/label&gt;&lt;/h1&gt; 
          &lt;/div&gt;
          &lt;div data-role="content" data-theme="b"&gt;
          &lt;h3&gt;&lt;label id="lblDialogHeader"&gt;&lt;/label&gt;&lt;/h3&gt;
              &lt;p&gt;&lt;label id="lblDialogMessage"&gt;&lt;/label&gt;&lt;/p&gt;
          &lt;/div&gt;
           &lt;div data-role="footer" data-theme="b"&gt;
              &lt;div data-role="navbar"&gt;
                  &lt;ul&gt;
                     &lt;a href="#" data-role="button" id="btnOK" data-icon="check"&gt;OK&lt;/a&gt;       
                      &lt;a href="#" data-role="button"  id="btnCancel"   data-rel="back" data-icon="delete" &gt;Cancel&lt;/a&gt;    
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>