title: Loading scripts after page load?
body: <p>I work with an advertising company, where we tag certain pages to track activity. A client of mine wants to fire off a javascript tag to track activity AFTER the page has finished loading entirely (to prevent the page content from loading slowly due to slow tag load times). </p>
  
  <p>An example tag that should load AFTER the page has fully loaded is:</p>
  
  <pre><code>&lt;script&gt;document.write('&lt;s'+'cript language="JavaScript" src="http://jact.atdmt.com/jaction/JavaScriptTest"&gt;&lt;/s'+'cript&gt;')&lt;/script&gt;
  </code></pre>
  
  <p>I was looking at some stackoverflow threads and I came across the below implementation which I think will work:</p>
  
  <pre><code>window.onload = function(){
    &lt;script language="JavaScript" src="http://jact.atdmt.com/jaction/JavaScriptTest"&gt;&lt;/script&gt;
  };
  </code></pre>
  
  <p>I tested this on my own webpage and I did get the tag to fire off, but I'm wondering if there are any alternate or more robust methods, ideally using jquery of some kind.</p>
  
  <p>Below is a sample implementation that the client tried, but it seems to break their page:</p>
  
  <pre><code>&lt;script&gt;
  jQuery(window).load(function () {$('&lt;script language="JavaScript" src="http://jact.atdmt.com/jaction/JavaScriptTest"&gt;&lt;/script&gt;').insertAfter('#div_name');});
  &lt;/script&gt;
  </code></pre>
  
  <p>I haven't done JQuery in a while and was hoping I could get some input from other members here. Is there any other way I can call the above script after page load using JQuery?</p>
  
  <p>Thanks,</p>