Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Javascript

Notices


 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 12-17-2015, 12:20 PM   #1
george.web13
Registered User
 
Join Date: Jul 2014
Location: Athens, Greece
Posts: 461
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/
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
george.web13 is offline   Reply With Quote

 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:57 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.