Saturday, December 19, 2009

Call a js function using a string variable having the function name

Hope the following coding snippet helps to know how :

<script>
testFCall();
function testFCall()
{
setTimeout('testCall(109)',0);
}

function testCall(val)
{
alert('val : '+val);
}
<script>