title: Phonegap build - Javascript not working
body: <p>I am developing a test app in PhoneGap build. Currently I'm trying to redirect to a page when the app loads. But when I tried to do that, it is not redirecting, instead staying in <em>index.html</em> page only. I am using <a href="https://testobject.com/" rel="nofollow noreferrer">TestObject</a> for testing the app.</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script type="text/javascript" charset="utf-8"&gt;
              function init() {
                  document.addEventListener("deviceready", onDeviceReady, true);
              }
  
              function onDeviceReady() {
                  alert("Device is ready");
              }
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body onload="init();"&gt;
          &lt;input type="button" onclick="location.href='http://google.com';" value="Go to Google" /&gt;
          Hai welcome to my app
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>config.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
      &lt;widget xmlns   = "http://www.w3.org/ns/widgets"
          xmlns:gap   = "http://phonegap.com/ns/1.0"
          id          = "com.mydomain.mobileApp"
          versionCode = "1" 
          version     = "1.0.0" &gt;
  
      &lt;!-- versionCode is Android only --&gt;
      &lt;!-- version is in major.minor.patch format --&gt; 
      &lt;name&gt;My App&lt;/name&gt;
  
      &lt;description&gt;
          An example for phonegap build app which wont show up in the playstore. 
      &lt;/description&gt;
  
      &lt;author href="https://YourWebsite.com" email="yourEmail@goesHere.com"&gt;
          Name Of The Author
      &lt;/author&gt;
  
  &lt;/widget&gt;
  </code></pre>
  
  <p>When I test this in browser, on clicking button it will redirect to <a href="http://google.com" rel="nofollow noreferrer">http://google.com</a>. But when I upload the apk (build from phonebuild) and upload to TestObject, button is coming. But on clicking it nothing happens. When I test the app,I'm getting like this.</p>
  
  <p><a href="https://i.stack.imgur.com/9MPhr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9MPhr.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me to find the issue. Thanks in advance.</p>