I use this function to execute/load script added by a Ajax request.
This works perfectly, and I can even call the javascript function loaded by ajax/innerHTML.
The question is what happens to the browsers memory use? I load the <script> tag into the head several times. maby 1000 if you do this long enough.
function executeScript(div)
{
var x = div.getElementsByTagName("script");
for(var i=0;i<x.length;i++)
{
eval(x[i].text);
var scriptTag = document.createElement('script');
scriptTag.innerHTML = x[i].text;
scriptTag.type = 'text/javascript';
var head = document.getElementsByTagName('head').item(0);
head.appendChild(scriptTag);
}
}
Any ideas?
Best regards
Alexander
www.keyteq.no