What are the differences between JavaScript's window.load
and JQuery's $(document).ready()
method? I need a function when open the page first check JavaScript means cookies then load the HTML or body?
Asked
Active
Viewed 86 times
-2

AstroCB
- 12,337
- 20
- 57
- 73

user3220457
- 43
- 1
- 7
-
1window.load is when assets are fully loaded, document.ready is when DOM elements are ready to be used. – SBD Sep 01 '14 at 20:54
-
It sounds like you actually want server-side code. – SLaks Sep 01 '14 at 21:00
-
The `load` event: everything's loaded. The `DOMContentLoaded` event: the DOM is loaded. – Derek 朕會功夫 Sep 01 '14 at 21:04
1 Answers
1
+1 to @Marciano's comment adding the network waterfall for visual depiction.

Sarbbottam
- 5,410
- 4
- 30
- 41