Results 1 to 2 of 2

Thread: Do u know the difference between jquery $(document).ready and $(window).load ???

  1. #1
    Join Date
    Aug 2014
    Location
    Thessaloniki,Greece
    Posts
    26

    Default Do u know the difference between jquery $(document).ready and $(window).load ???

    I thought, that there is no difference between these two. That both work and do stuff,
    when the page has loaded. WRONG!!!
    $(document).ready work when the DOM is ready.
    That means that can be executed even when the pictures have NOT been loaded, cause the DOM is ready (the structure of the page and its elements)
    But, when you need to do something, when EVERYTHING has loaded,
    comes the $(window).load.
    I found it out, when i needed to pass a javascript variable at the start of the page, and do something with that. I made it with $(document).ready and $(window).load

    I found also this relative article. Check it out!
    https://4loc.wordpress.com/2009/04/2...vs-windowload/

  2. #2
    Join Date
    Apr 2020
    Posts
    704

    Default

    The key difference between $(document). ready() and $(window). load() event is that the code included inside onload function will run once the entire page(images, iframes, stylesheets,etc) are loaded whereas the $(document). ready() event fires before all images,iframes etc.

Similar Threads

  1. Top three JQuery plugins for images :
    By Eathelin in forum Web Design Solutions
    Replies: 6
    Last Post: 03-07-2023, 10:54 AM
  2. What do you know about load-balanced servers?
    By President in forum Web Hosting Community
    Replies: 12
    Last Post: 09-18-2020, 11:23 AM
  3. What is jQuery?
    By riprook7 in forum Web Design Solutions
    Replies: 20
    Last Post: 11-22-2019, 07:57 AM
  4. css/jquery responsive effect
    By marios.frag in forum Web Design Solutions
    Replies: 6
    Last Post: 04-24-2018, 10:21 AM
  5. 7Host.com: ProCloud Solution with scalability, EU location, Load Balancing
    By 7Host in forum Web Hosting and Related Offers Forum
    Replies: 0
    Last Post: 04-08-2013, 06:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •