title: How to call external function inside jquery code from html?
body: <p>I need to load function to get data from external JS included in HTML file, and I'm doing this:</p>
  
  <pre><code>&lt;body onLoad="getTicket();"&gt;
  ......
  &lt;/body&gt;
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;head&gt;
      &lt;script src="js/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="js/functions.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script&gt;
          $(document).ready(function() {
              getTicket();
          });
      &lt;script&gt;
      &lt;/head&gt;
  &lt;body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;head&gt;
      &lt;script src="js/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="js/functions.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script&gt;
          getTicket();
      &lt;script&gt;
      &lt;/head&gt;
  &lt;body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And I have this in functions.JS:</p>
  
  <pre><code>functioOne() {
  
  }
  
  functionTwo() {
  
  }
  
  $(document).ready(function() {
      ...
      .....
      function getTicket() {
          //to do
      }
  });
  </code></pre>
  
  <p>But does'nt work and in the console display this:</p>
  
  <pre><code>Uncaught ReferenceError: getTicket is not defined 
  </code></pre>
  
  <p>Regards.</p>