Ok. I think the best way to explain this will be by an example. This is pseudo code to a degree.
$.each(data, function(i,item){ myFunction() }); Now. 'data' is from a json call. this works. 'myFunction' does all sorts of stuff. It adds an li, then populates it with a bunch of stuff from ajax calls, and this works too. however, because it does so much, if i just let it loop away, it gets all confused. so, i put in a variable (window.lockAdd) to lock 'myFunction' from running again until its all completed. howwwwever.... the 'each' loops away, and only runs 'myFunction' once, because it runs so damn fast. any ideas what i can do in the 'each' to pick up that the window.lockAdd variable isnt going to let myFunction run yet, so just to hang around until its finished, and then fire off myFunction again?