Reload JS dynamically
<p>I am currently working on a page that displays a graph which can be modified by clicking on some buttons. To display the graph, I use amCharts script (see <a href="http://amcharts.com" rel="nofollow">http://amcharts.com</a>). The code that displays the chart is generated dynamically using ASP. However, I have a problem when reloading the graph when the user clicks on one of the buttons. I try to clear the div in which the graph is written and load the new JS script using :</p>

<pre><code>document.getElementById("flashcontent").innerHTML = ""; 
var head = document.getElementsByTagName("HEAD")[0];
var node = document.createElement('script');
node.type = 'text/javascript';
node.async = true;
node.src = strQueryString;  
head.appendChild(node);
</code></pre>

<p>I verified a lot of time that the <code>strQueryString</code> variable is right and the Firebug says that the right script is loaded. However, the div is cleared but my JS is not executed. Note : all my JS is loaded dynamically using a similar code when the page is loaded.</p>

<p>Thanks !</p>
