Was the event loop model used in web browsers to control interaction between DOM events concomitantly developed by Brendan Eich with JavaScript?

余生长醉 提交于 2019-12-25 18:53:43

问题


Was the event loop evaluation model used in web browsers to control interaction between DOM events (and later the network) concomitantly developed by Brendan Eich with JavaScript?

Or did it pre- or post-date JavaScript?

Edit: I am specifically asking about the placement of the event-loop inside browsers. I am aware the event loop is a long-standing invention.


回答1:


The event loop predates javascript.. but just by a tiny bit.

The event loop was introduced to support progressive download of pictures in Netscape. And almost immediately it was also used to support early rendering where DOM elements are displayed on screen before all images are downloaded.

At the time, other browsers displayed blank white screen while images are downloaded. The net effect is that Netscape appears to be faster even though it takes the same amount of time to download and render the complete page.

Once the event loop is there (initially to handle network code for downloading images) javascript processing was simply added into the loop.



来源:https://stackoverflow.com/questions/29799316/was-the-event-loop-model-used-in-web-browsers-to-control-interaction-between-dom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!