I have JQuery each statement that rolls on array of objects and checks if a value in that object is empty to let the user enter that value in a prompt window using bootbox then continue the loop till done.
after the each statement completes ajax function should fire holding the objects that the each refined.
problem is the ajax function fires up asynchronously during the each statement run time!
$.each(objs,function(k,v){
if (v == empty)
//prompt bootbox modal to enter the value and (at this time ajax is fired
v=bootboxpromptvalue )
})
$.ajax({
..
...
....
data:objs
})
Question is why ajax fires during the each runtime, since $.each statements supposed to be synchronous and anything after it should run after it is completes?