when is the Javascript event loop triggered in a HTML page?

extra

New Member
I'am 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:\[code\]<html> <head> <script> MANY INLINED SCRIPTS </script> <script src="http://stackoverflow.com/questions/12729438/file.js"></script> <script> setTimeout(function(){...}, TIME)</script> . . .\[/code\]and the page goes, with probably this structure repeating itself until the \[code\]</html>\[/code\] 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.
 
Back
Top