title: How to find the active page of the first pageinit in jQM?
body: <p>I need to get the ID of the active page element loaded by <a href="/questions/tagged/jquery-mobile" class="post-tag" title="show questions tagged 'jquery-mobile'" rel="tag">jquery-mobile</a>.  I know that we can use <code>$.mobile.activePage</code> to get the current page in view and that we can get the ID of this element using <code>$.mobile.activePage.attr('id')</code>. However, it is <code>undefined</code> on first load of the application.  In my particular application, I want users to be able to enter from any URL and I need to know the currently loaded page in order to properly initialise my navigation system</p>
  
  <pre><code>$(document).bind('pageinit', function() { 
      if($.mobile.activePage !== undefined) {
          console.log($.mobile.activePage.attr('id'));
      }
      else {
          console.log('1st page load detected');
      }
  });
  </code></pre>
  
  <p><strong>Outputs:</strong> <code>1st page load detected</code> on first load and the ID on every subsequent page.  How can I get the ID on the first load?!?</p>