title: Detect if script has already loaded or not
body: <p>It seems that <code>helloworld.js</code> gets loaded multiple times based on the number of times I click <code>#load</code>.  I say this because when I look at Google Chromes Developer Tools Network tab, it shows <code>helloworld.js</code> as many times as I click <code>#load</code>.</p>
  
  <pre><code>$(document).ready(function() {
  
      $("#load").click(function(){
          $.getScript('helloworld.js', function() {
              hello();
          });
      });
  
  });
  </code></pre>
  
  <p>The <code>hello()</code> function looks like this:</p>
  
  <pre><code>function hello(){
      alert("hello");
  }
  </code></pre>
  
  <p>Is it possible to detect if <code>helloworld.js</code> has already loaded?</p>
  
  <p>So if it hasn't loaded, load it, and if it has loaded, don't load it.</p>
  
  <p>This is what Developer Tools currently shows me if I click the <code>#load</code> button 4 times:</p>
  
  <p><img src="https://i.stack.imgur.com/pH7FQ.png" alt="enter image description here"></p>