title: jQuery Mobile breaks Phonegap deviceready event
body: <p>So i've gotten jQuery 1.8.2 working with Phonegap no problem, but as soon as I add in jquery.mobile.1.2.0, the default Phonegap example breaks. the deviceready event stops firing.</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
      &lt;meta name="format-detection" content="telephone=no" /&gt;
      &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /&gt;
      &lt;link rel="stylesheet" type="text/css" href="css/index.css" /&gt;
      &lt;title&gt;Hello World&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="app"&gt;
          &lt;h1&gt;Apache Cordova&lt;/h1&gt;
          &lt;div id="deviceready" class="blink"&gt;
              &lt;p class="event listening"&gt;Connecting to Device&lt;/p&gt;
              &lt;p class="event received"&gt;Device is Ready&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;input   type="text" name="firstname" id="firstname" /&gt;  
      &lt;a href="#" class="btn" onclick="displayHello();"&gt;Say Hello&lt;/a&gt;
      &lt;script type="text/javascript" src="cordova-2.4.0.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          app.initialize();
          function displayHello(){
              var name = document.getElementById("firstname").value;  
              navigator.notification.alert("My name is "+ name);  
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>var app = {
  // Application Constructor
  initialize: function() {
      this.bindEvents();
  },
  // Bind Event Listeners
  //
  // Bind any events that are required on startup. Common events are:
  // 'load', 'deviceready', 'offline', and 'online'.
  bindEvents: function() {
      document.addEventListener('deviceready', this.onDeviceReady, false);
  },
  // deviceready Event Handler
  //
  // The scope of 'this' is the event. In order to call the 'receivedEvent'
  // function, we must explicity call 'app.receivedEvent(...);'
  onDeviceReady: function() {
      app.receivedEvent('deviceready');
  },
  // Update DOM on a Received Event
  receivedEvent: function(id) {
      var parentElement = document.getElementById(id);
      var listeningElement = parentElement.querySelector('.listening');
      var receivedElement = parentElement.querySelector('.received');
  
      listeningElement.setAttribute('style', 'display:none;');
      receivedElement.setAttribute('style', 'display:block;');
  
      console.log('Received Event: ' + id);
  }
  };
  </code></pre>
  
  <p>So this is the default code example Phonegap comes with, and i've only added</p>
  
  <pre><code>&lt;script type="text/javascript" src="js/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>in index.html.</p>
  
  <p>Not sure what is going on as it seems other people have gotten Phonegap and jQuery Mobile to work just fine together.</p>
  
  <p>I've tried dumbing the js down and just calling the deviceready event.</p>
  
  <p>And I've tried following this solution and the other posted below it to no avail.</p>
  
  <p><a href="https://stackoverflow.com/questions/10945643/correct-way-of-using-jquery-mobile-phonegap-together">Correct way of using JQuery-Mobile/Phonegap together?</a></p>
  
  <p>But the same thing happens. With jQuery Mobile deviceready never fires, without it, it fires fine.</p>
  
  <p>Any help would be appreciated! Maybe i'm just missing something simple here.</p>
  
  <p>I have also tried different version combinations of jQuery and jQuery Mobile with no luck.
  I was running the Android Phonegap version and cordova-2.3.0. I recently tried upgrading to cordova-2.4.0 to see if that would help but nothing...</p>
  
  <p>Update: No errors are thrown in the LogCat/DDMS</p>