title: Uncaught ReferenceError: script is not defined
body: <p>In jQuery, how do I call a function in a script that I retrieve via code?</p>
  
  <p>I have a javascript file called <code>testjavascript.js</code></p>
  
  <p>Here is the code:</p>
  
  <pre><code>function testfunctionwithdata(testdata)
  {
      alert(testdata);
  }
  function testfunction()
  {
      alert("testfunction");
  }
  </code></pre>
  
  <p>I also have a javascript called <code>testcalljavascriptfunction.js</code></p>
  
  <p>Here is the code:</p>
  
  <pre><code>var scripturl = "/objects/testjavascript.js";
  
  $.getScript(scripturl, function() {
     script.testfunction();
  });
  </code></pre>
  
  <p>When I load the <code>testcalljavascriptfunction.js</code>script from an <code>index.html</code> page, I am getting the following error in the console:</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: script is not defined</p>
  </blockquote>