43
rated 0 times
[
47]
[
4]
/ answers: 1 / hits: 15523
/ 14 Years ago, sun, march 6, 2011, 12:00:00
I've just asked about calling functions by name, now I want to process return
statement after SetTimeout
:
function ECall(funcName, arg)
{
command += (;
for (var i=1; i<arguments.length; i++)
{
command += ' + arguments[i] + ';
if (i != arguments.length-1) command += ',';
}
command += );
//var funcPtr = eval(funcName);
//return funcPtr(arg); // This works, but I need SetTimeout
setTimeout('window['' + funcName + '']' + command, 1000);
}
setTimeout
works great, but I have to save return value of called function. When I write: setTimeout('alert(window['' + funcName + '']' + command + ')', 1000);
It alerts return value of function. How can I store it?
More From » function