J
jeet_sen
Hi,
My external javascript test.js contains a variable definition var a =
"Hello,world!!";
I dynamically loaded the script test.js using the following fucntion:
function loadScript(url)
{
var e = document.createElement("script");
e.src = url;
e.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
Function call : loadScript("test.js");
Now the problem is, though my script test.js gets loaded but I cannot
access the variable defined in the script.
Can anyone help me out ?
Regards,
Suvajit
My external javascript test.js contains a variable definition var a =
"Hello,world!!";
I dynamically loaded the script test.js using the following fucntion:
function loadScript(url)
{
var e = document.createElement("script");
e.src = url;
e.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
Function call : loadScript("test.js");
Now the problem is, though my script test.js gets loaded but I cannot
access the variable defined in the script.
Can anyone help me out ?
Regards,
Suvajit