Tagged Posts ‘variable’

8. December 2015
von Blackbam
Thats a very annoying common problem I discovered - if calling Ajax within a Javascript loop the callback function will be called asynchronously. That means: All local variables in the callback function will have their future value instead the value they had when the loop was running.   Example 1 (probably unwanted results): var types […]
Share