Wait For Load State explaination

I have been using the Wait For Load State in my scripts, in fact it has helped me a number of times but I do not really know why and I am having a hard time finding a good explanation of the options…

we have:
‘load’ - wait for the load event to be fired. (Default)
‘domcontentloaded’ - wait for the DOMContentLoaded event to be fired.

What does “event to be fired” mean?
I was expecting it to be waiting for things to settle down not for something to be fired up?


This article does a pretty good job explaining the PageLoadStates.

Page: DOMContentLoaded, load, beforeunload, unload (javascript.info)


Perfect thanks CalRIPkins.

  • DOMContentLoaded – the browser fully loaded HTML, and the DOM tree is built, but external resources like pictures <img> and stylesheets may not yet have loaded.
  • load – not only HTML is loaded, but also all the external resources: images, styles etc.
1 Like