I want to to execute the handlers I pass to the "ready" function in the order there were inserted.
I saw with a jsFiddle that the order is opposite- LIFO – like a stack.
Is there a way to execute in order of FIFO like a queue?
(obviously I can’t just insert the handlers in opposite order…)
They will be executed in the order that they were inserted by default.
The reason why the fiddle you saw looks like a LIFO stack is because the
aftermethod adds the number directly after the element with id ‘logs’. So 1 gets added first, so the text looks like:Then 2 gets added directly after logs:
… continuing up to:
See here for your fiddle with alerts so you can see the order more clearly.