I have an ajax call that gets data from a file. i use this data to parse some elements on the window.
However, I also use another ajax call before, and i use it to decide which parameteres to send in the other ajax call..
I know how to "chain" the calls, using the success event. but, in some cases it is impossible to chain them and they are called separately. in that case i need another mechanism to do the trick.
for now i use timers and flags.. but i understood that Promises
are the best modern way. but i can't figure out how to use it in that context.
can anyone help with a skeleton, explained - code?
thank you