1

What is the difference between these two, in term of functionality?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Vincent Chua
  • 969
  • 6
  • 20
  • 41

2 Answers2

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
  • 1
    jquery `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