Is there event that triggers after DOM was loaded but before any external assets like images, styles,iframes, etc?

StackOverflow https://stackoverflow.com/questions/8681475

  •  06-05-2021
  •  | 
  •  

Question

I'd would also like to pause fetching of external files until my event function finishes, is it possible ? If not on clean JS, maybe with jQuery ?

No correct solution

OTHER TIPS

There is no such event cause you can't be ensure that no file was loaded before the DOM tree is build. Its an asynchrones process, where the DOM is parsed and builded. Whenever the parser comes to a link for an external file, he starts to load this. So when it could happend that some of these files are loaded before the parsed comes to the end of the body tag. Maybe you're looking for something different.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top