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
  •  | 
  •  

سؤال

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 ?

لا يوجد حل صحيح

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top