title: How To Call jQuery Function From Another JS File
body: <p>I have the following <code>main.js</code></p>
  
  <pre><code>$(document).ready(function() {
    $.getScript('another.js', function() {
      another();
    });
  });
  </code></pre>
  
  <p>...and the following <code>another.js</code></p>
  
  <pre><code>$(function another() {
    $('section#my-section').after('&lt;a href="#"&gt;my link&lt;/a&gt;');
  });
  </code></pre>
  
  <p>The directory structure is as follows:</p>
  
  <pre><code>+ my.html
  + js
    +--- main.js
    +--- another.js
  </code></pre>
  
  <p><code>another()</code> is never called.  Why?  Could anyone point me in the right direction?</p>
  
  <p>Thanks!</p>