title: jQuery Mobile get current page
body: <p>I am using jQuery Mobile 1.1.1 and Apache Cordova 2.0.0. I want my app to exit when I press back button but only if current page have ID = feedZive. I am using following code to do it:</p>
  
  <pre><code>function onDeviceReady(){
      document.addEventListener("backbutton", onBackKeyDown, false);
      function onBackKeyDown(){
          if ($.mobile.activePage.is("#feedZive")){
              navigator.app.exitApp();
          }
          else{
              navigator.app.backHistory();
          }
  
      }
  };
  </code></pre>
  
  <p>However it looks like I can't get the current page because I have tried the following code:</p>
  
  <pre><code>var activePage = $.mobile.activePage;
  alert(activePage);
  </code></pre>
  
  <p>and my alert is showing undefined. I have also tried to change <code>$.mobile.activePage</code> to <code>$.mobile.activePage.attr("id")</code> but it didn't work.</p>