title: How does jQuery getScript method ensure secure execution of dynamically loaded JavaScript?
body: <p>I want to dynamically load JS file using AJAX and execute it. I am referring <a href="http://ntt.cc/2008/02/10/4-ways-to-dynamically-load-external-javascriptwith-source.html" rel="noreferrer">this page</a> which says, "At this time,the preferred way of injecting JS code seems to be to use AJAX to load the JS source, then eval() the code."</p>
  
  <p>But I am worried of using eval to execute the script. Just to see how jQuery implements this I checked its source and found this:</p>
  
  <pre><code>getScript: function( url, callback ) {
      return jQuery.get( url, undefined, callback, "script" );
  }
  </code></pre>
  
  <p>Then I searched for jQuery get method. But there are several get methods defined. I am new to OOP in JS and don't understand where to look for the correct get method.</p>
  
  <p>I want to know how it executes the script - whether it uses eval or not and if yes, how is it secure. </p>
  
  <p>Can someone guide me how I can look for the correct get method.</p>