L
Laser Lips
Hi all.
I'm trying to add some scripts dynamically but it's not working.
I'm trying to do something like this...
var scripts=[];
scripts[0]="/csp/app/lib/t1.js";
scripts[0]="/csp/app/lib/t2.js";
for(var x=0;x<scripts.length;x++)
{
newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = scripts[x];
document.getElementsByTagName("head")[0].appendChild(newScript);
}
But neither script gets loaded.
I've tried using absolute and relative URL's
I've also tried loading scripts from other websites, but doesn’t work
for me.
Any ideas please?
Graham
I'm trying to add some scripts dynamically but it's not working.
I'm trying to do something like this...
var scripts=[];
scripts[0]="/csp/app/lib/t1.js";
scripts[0]="/csp/app/lib/t2.js";
for(var x=0;x<scripts.length;x++)
{
newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = scripts[x];
document.getElementsByTagName("head")[0].appendChild(newScript);
}
But neither script gets loaded.
I've tried using absolute and relative URL's
I've also tried loading scripts from other websites, but doesn’t work
for me.
Any ideas please?
Graham