0

The defination is : onload is most often used within the element to execute a script once a web page has completely loaded all content (including images, script files, CSS files, etc.).

But i am confused with the "completely loaded". There are macro-task queue and micro-task queue in an event loop. I wonder how browser fire the load event in more details.

I suppose that it might be fired when the last task queue is finished according to my experiments. But i dont know where can i find a Standard or related information, or should i read source code of webcore or V8 to find the answer?

luoxl
  • 1
  • http://stackoverflow.com/questions/25915634/difference-between-microtask-and-macrotask-within-an-event-loop-context this may shed some light – Sterling Archer Aug 19 '16 at 13:47
  • But it still did not explain the relation between onload Event with task queues – luoxl Aug 20 '16 at 07:01

0 Answers0