I'm trying to execute the following JavaScript
code, but I'm getting error.
var services = [{place_id:'okkkkkk'}];
var delay = 100;
var nextAddress = 0;
function theNext() {
if (nextAddress < services.length) {
setTimeout('getDetails("' + services[nextAddress].place_id + '", theNext)', delay);
nextAddress++;
} else {
}
}
function getDetails(address, next) {
alert('ok');
}
theNext();
Errror:
VM687:1 Uncaught ReferenceError: getDetails is not defined
The function is defined and I'm not sure whats causing the problem: