You are here: irt.org | FAQ | JavaScript | Object | Q1271 [ previous next ]
Use an enabler function (in this case functionB) to return a string made up of the actual values of the array, to be used as the string to be evaluated once the timer expires:
<script language="JavaScript"><!--
function functionA() {
var parms = new Array('Hello','Cruel','World');
setTimeout(functionB(parms),7000);
}
function functionB(parms) {
var s = 'functionC("';
for (var i=0; i<parms.length; i++) s += parms[i] + ' ';
return s +'")';
}
function functionC(string) {
alert(string);
}
functionA();
//--></script>