I was wondering when a received ajax response gets executed. After searching I read about the Event loop, but I am not sure if I interpreted it correctly.
Is it like this?:
- Start execution
- Ajax request is sent
- proceeds execution
- Ajax reply is received and buffered as a message
- executing untill there is nothing to execute
- Any triggered events are buffered in the message queue aswell.
- nothing to execute so read next message and execute the associated function.
Does this mean that when you send an ajax request and then before the ajax response is received 1000 interval triggers and 1000 click events have occured that the ajax response will be handled after the 1000 interval triggers and 1000 click event messages have been handled?
I did a small test to test this and this seems to be the case, but i'd like to be sure and to know if there are exceptions or tricky things I should know about.