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 http://amcharts.com). 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 :
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);
I verified a lot of time that the strQueryString
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.
Thanks !