2 Replies Latest reply on Sep 20, 2016 11:04 AM by low_right

    deviceready event never fires

    low_right

      I am building a phone gap app using build.phonegap.com. Here's the javascript I have in my index.html file:

       

         <script>

            window.onload = function() {

              alert("window.onload!");

              document.addEventListener("deviceready", onDeviceReady, false);

       

       

              function onDeviceReady() {

                alert("onDeviceReady!");

                window.open = cordova.InAppBrowser.open;

              }

            }

          </script>

       

      When running the built app on iPhone, the "window.onload!" alert appears, but the "onDeviceReady!" alert never does. What am I missing?