I am trying to run a simple recursive function call using setTimeout() but with little success, can someone help me out.
This is my code fragment,
[CODE]function ajaxQ(param){
if(accessKey){
accessKey = false;
ajaxRequest(“dj-content/maps/layerResults.php” + param, loadLayerHandle);
}else{
alert(param);
timer = setTimeout(‘ajaxQ(param)’,1000);
}
}
The variable param is not getting passed to the function after setTimeout(‘ajaxQ(param)’,1000), someone also suggested I try this but nothing happens.
[CODE] function ajaxQ(param){
if(accessKey){
accessKey = false;
ajaxRequest(“dj-content/maps/layerResults.php” + param, loadLayerHandle);
}else{
alert(param);
timer = setTimeout(‘function () {ajaxQ(param);}’,1000);
}
}
Thanks in advance,
Levi