1

guys. I've been doing some research into these two functions for my javascript exercises and I'm pondering on what seems to be the clear difference between them. I know for some that might come across as kind of "duhish" but I'm still learning the ropes on programming in general. If you guys could help a guy out and give me some details on what each accomplishes and how it accomplishes what they set out, that might help me out in the future for other little projects I come across.

1 Answers1

1

The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. A very different event load should be used only to detect a fully-loaded page. It is an incredibly popular mistake to use load where DOMContentLoaded would be much more appropriate, so be cautious.

Source

Tareq
  • 5,283
  • 2
  • 15
  • 18