jQuery

elevateZoom (Requires jQuery)

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!

Activation Code - Donation (Multiple Options)



Donate

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

No comments:

Post a Comment

ADS - Multi Share Calculator

https://windowsportableapps.blogspot.com/2019/03/multi-share-calculator.html