title: Check when script has loaded
body: <p>I am trying to call a function that, on the load of the script above it, will run some JavaScript.</p>
  
  <pre><code>&lt;script src="../Layout/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="helperscript.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          var itemid = '1';
          if(itemid)
          {
              idselect(itemid);
          }
      })
  &lt;/script&gt;
  </code></pre>
  
  <p>helperscript.js contains the function <code>idselect</code>.
  When I load the page I get an error saying that <code>'idselect is undefined'</code>, even though it is in the above file. I suspect that this is due to helperscript not being fully loaded yet, but that is just a hunch.</p>
  
  <p>Can anyone help me?</p>