The onload event is a standard event in DOM, while the ready event is specific to jQuery.
The purpose of the ready event is that it should occur as soon as the document is loaded, so that code that adds functionality to elements in the page does not have to wait for everything to load.
The ready event occurs after the HTML document is loaded, while the onload event occurs after all content (such as images) is loaded.
From: https://stackoverflow.com/questions/3698200/window-onload-vs-document-ready
Similar Posts:
- The Difference between $(document).ready, window.onload and $(window).load(function (){})
- ”Cannot read property ‘addEventListener’ of null“
- Error in JS function referencing public page [How to Solve]
- [How to Solve] Cannot set property ‘onclick’ of null
- Always report uncaught error:[$ injector:modulerr ]Solutions to errors
- Document.body.clientheight cannot get the browser page height correctly
- window.location And window.open The difference between
- How to Solve Error: Cannot set property ‘onclick’ of null
- Function of double slash in XPath / / double slash
- A parser-blocking, cross site (i.e. different eTLD+1) script, is invoked via document.write