0

I know that jquery has a ready() function and I've heard that it has a on load(). But can anybody tell me all the different types and when they get run?

I know ready happens when the all the HTML DOM elements are loaded and load happens when all images and extra assets load like iframes perhaps?

But are there other types, and what are they?

  • There aren't any others, AFAIK. I linked to a question that explains the difference. – Barmar Feb 16 '16 at 21:36
  • What is wrong with the docs of jQuery? https://api.jquery.com/ready/ – axel.michel Feb 16 '16 at 21:36
  • jQuery really has only one `load()` function, and it's a shortcut for `$.ajax` that inserts content, the older versions of `load()` that also worked for events are deprecated. For events it's now `$(elem).on('load' ...`, and you probably want `$(window).on('load' ...` which is the same as [`window.onload`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onload) <- and all the information about that can be found on MDN – adeneo Feb 16 '16 at 21:37
  • A good help `window.onload` vs. `body.onload` vs. `document.onready` can be found here. http://stackoverflow.com/questions/3474037/window-onload-vs-body-onload-vs-document-onready – Farzad Yousefzadeh Feb 16 '16 at 21:37

0 Answers0