title: Call phonegap/cordova plugin function within html
body: <p>I'm very new to javascript and I started to make some practice with Phonegap. </p>
  
  <p>I'm trying to call a plugin function within html but if I call it within a button it works fine:</p>
  
  <pre><code>&lt;button onclick="cordova.plugins.autoStart.disable()"&gt;Stop AutoStart&lt;/button&gt;
  </code></pre>
  
  <p>while if I try to call it directly I get: "autoStart is not defined" in the console.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      cordova.plugins.autoStart.enable();
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I call it into html without the button?</p>
  
  <p>Update1:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="format-detection" content="telephone=no" /&gt;
      &lt;meta name="msapplication-tap-highlight" content="no" /&gt;
      &lt;meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" /&gt;
      &lt;meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" /&gt;
  
       &lt;link rel="stylesheet" href="css/styles.css"&gt;
       &lt;link rel="stylesheet" href="css/jquery-ui.min.css"&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;window.jQuery || document.write('&lt;script src="js/jquery-1.11.2.min.js"&gt;&lt;\/script&gt;')&lt;/script&gt;        
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" src="cordova.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;button onclick="cordova.plugins.autoStart.disable()"&gt;Stop AutoStart&lt;/button&gt;
      &lt;div class="perspective"&gt;
          &lt;img id="box1"/&gt;
          &lt;img id="box2"/&gt;
      &lt;/div&gt;
  
      &lt;p id="date"&gt;&lt;/p&gt;
      &lt;p id="time"&gt;&lt;/p&gt;
  
      &lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          app.initialize();
          jQuery(document).ready(function () {
              //THE ERROR IS HERE
              cordova.plugins.autoStart.enable();
          });
      &lt;/script&gt;        
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>