- Alcatel (6)
- Android (6)
- Blogger (10)
- Calculators (1)
- Facebook (1)
- Games (4)
- GitHub (1)
- Html-Css-Js (45)
- Illustrator (2)
- InfoSec (13)
- Photoshop (4)
- PHP (11)
- Unicode (2)
- Windows (2)
jQuery
elevateZoom (Requires jQuery)
Microsoft Store (Donation)
Facebook Messenger (Donation)
Many donors of this blog prefer to donate their money through Facebook Messenger!
Click here to go to this blog's Facebook Page!
Thank you!
Click here to go to this blog's Facebook Page!
Thank you!
Request Web\PHP\JavaScript\HTML Project !
Contact us if you want us to develop a Web\PHP\JavaScript\HTML project for you!
Advertise On This Blog!
If you want a Product\Service\Event to be advertised on this blog, feel free to contact us!
Ads (Reserved)
Monday, April 24, 2017
JavaScript - Execute JS codes after DOM or Page load
In the most cases, some CSS/JavaScript/jQuery codes require only "DOM" to be completely loaded in order to work properly!
Document Object Model (DOM) load:
- When HTML document has been completely loaded and parsed
- Does not include stylesheets, images, and subframes loads!
Page load:
- When HTML document has been completely loaded and parsed
- Includes stylesheets, images, and subframes loads!
From all the alternatives demonstrated below, "JQuery" is the recommended one because it allows multiple onload calls!
DOM onload - with anonymous functions (jQuery)
DOM onload - with named functions (jQuery)
window onload - with anonymous functions (JavaScript)
window onload - with named functions (JavaScript)
body onload - with named functions (Html)
document onload - with anonymous functions (JavaScript)
document onload - with named functions (JavaScript)
Keywords:
JavaScript - Execute JS codes after DOM or Page load
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment