title: How to force a script reload and re-execute?
body: <p>I have a page that is loading a script from a third party (news feed). The <code>src</code> url for the script is assigned dynamically on load up (per third party code).</p>
  
  <pre><code>&lt;div id="div1287"&gt;
      &lt;!-- dynamically-generated elements will go here. --&gt;
  &lt;/div&gt;
  
  &lt;script id="script0348710783" type="javascript/text"&gt;
  &lt;/script&gt;
  
  &lt;script type="javascript/text"&gt;
      document.getElementById('script0348710783').src='http://oneBigHairyURL';
  &lt;/script&gt;
  </code></pre>
  
  <p>The script loaded from <code>http://oneBigHairyURL</code> then creates and loads elements with the various stuff from the news feed, with pretty formatting, etc. into <code>div1287</code> (the Id "div1287" is passed in <code>http://oneBigHairyURL</code> so the script knows where to load the content).</p>
  
  <p>The only problem is, it only loads it once. I'd like it to reload (and thus display new content) every n seconds.</p>
  
  <p>So, I thought I'd try this:</p>
  
  <pre><code>&lt;div id="div1287"&gt;
      &lt;!-- dynamically-generated elements will go here. --&gt;
  &lt;/div&gt;
  
  &lt;script id="script0348710783" type="javascript/text"&gt;
  &lt;/script&gt;
  
  &lt;script type="javascript/text"&gt;
      loadItUp=function() {
          alert('loading...');
          var divElement = document.getElementById('div1287');
          var scrElement = document.getElementById('script0348710783');
  
          divElement.innerHTML='';
          scrElement.innerHTML='';
          scrElement.src='';
          scrElement.src='http://oneBigHairyURL';
          setTimeout(loadItUp, 10000);
      };
      loadItUp();
  &lt;/script&gt;
  </code></pre>
  
  <p>I get the alert, the div clears, but no dynamically-generated HTML is reloaded to it.</p>
  
  <p>Any idea what I'm doing wrong?</p>