[quote=125301:@Maurizio Rossi]Hi Michel,
I don’t think you are correct.
The nature of the TCP protocol does guarantee the order of the data sent in a way completely independent of the route that frames takes to reach destination.
The only way to have an no particular order condition is when you have different connections and send data spread across them.[/quote]
The Transport Layer indeed insures the integrity of a message and makes sure all packets arrive in order for the datastream to be identical to what was sent. But it does not do the same for different messages, which are effectively different data streams over one connection.
But you do not have to take my word for this. You just bumped into it.
I have noticed that when these events are very near each other, the sequence at which the browser send these events to the application differs from the order of the events seen and processed by the application.
Whatever your personal belief in the matter, reality is here, as you report it yourself. I frankly doubt very much it could be a browser bug. But you can verify that by using different browsers.
My point was not theoretical at all. I was merely offering a possible way of dealing with the phenomenon, regardless of its possible cause.
I do not pretend to explain, or understand everything, and may very well be proven wrong. Only imbeciles can have delusions of universal knowledge. In the meantime, the important thing is to get code to work. And I may be able to share a thing or two about that. Hope this helps.