What is the difference between these two, in term of functionality?
Asked
Active
Viewed 1,027 times
1
-
http://stackoverflow.com/questions/3698200 – Tushar Gupta - curioustushar May 07 '14 at 10:40
-
2possible duplicate of [js window.onload vs jquery $(document).ready()?](http://stackoverflow.com/questions/3698200/js-window-onload-vs-jquery-document-ready) – Jacob Goulden May 07 '14 at 10:40
-
I don't think so, the .load() I meant was this https://api.jquery.com/load/ – Vincent Chua May 07 '14 at 10:43
2 Answers
1
Both are different and has no common load is function or method of jquery and onload is event !
onload Execute a JavaScript when a page is finished loading:
<body onload="myFunction()">
load , Load data from the server and place the returned HTML into the matched element.
$( "#result" ).load( "ajax/test.html" );

Suraj Rawat
- 3,685
- 22
- 33
-
1jquery `load()` is not always used in combination with AJAX! It could also be used to detect the complete load of a element. – dude Oct 27 '14 at 14:17
0
Both action is same but jquery .load() required jquery library while javascript .onload is an in buit function doesn't require any framework and also faster then jquery load()

Rohit Batham
- 1,238
- 1
- 9
- 13