I'm aware that the JS function (i.e. setTimeout(function(){...}, TIME)
) places the function it received as a parameter in the Browser's event loop, and that this event loop will be processed after all inline/synchronous JS call are processed.
But what actually happens when he have the following HTML page structure:
<html>
<head>
<script> MANY INLINED SCRIPTS </script>
<script src="file.js"></script>
<script> setTimeout(function(){...}, TIME)</script>
.
.
.
and the page goes, with probably this structure repeating itself until the </html>
is reached.
When will the Event queue be processed in such situation?
edit: I want to create some sort of Lazy Loader for the scripts in my page. I rely in content coming from other sources that should appear only after the DOM is parsed and, hopefully, responsive.