Implement a loop to place markers on the map:
for (i = 0; i <= 6; i++) {
_coord = prj_markers[i];
alert(i);
instance.set_marker(instance, provider, i, _coord, divBlock);
}
This code displays "0" in an alert once and executes instance.set_marker as expected.
Now try placing the alert after executing instance.set_marker:
for (i = 0; i <= 6; i++) {
_coord = prj_markers[i];
instance.set_marker(instance, provider, i, _coord, divBlock);
alert(i);
}
The alert displays "6" only ONCE instead of six times. What could be causing this discrepancy?