title: Waiting for dynamically loaded script
body: <p>In my page body, I need to insert this code as the result of an AJAX call:</p>
  
  <pre><code>    &lt;p&gt;Loading jQuery&lt;/p&gt;
      &lt;script type='text/javascript' src='scripts/jquery/core/jquery-1.4.4.js'&gt;&lt;/script&gt;
      &lt;p&gt;Using jQuery&lt;/p&gt;
      &lt;script type='text/javascript'&gt;
          $.ajax({
              ...
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>I can't use <code>$.load()</code> since the document has already loaded, so the event doesn't fire.</p>
  
  <p>Is this safe? If not, how do I make sure the jquery script has loaded before my custom, generated code is executed.</p>