Vincent Chua
Vincent Chua

Reputation: 1009

Jquery .load() and javascript .onload difference?

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

Upvotes: 1

Views: 1051

Answers (2)

user5296864
user5296864

Reputation:

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()

Upvotes: 0

Suraj Rawat
Suraj Rawat

Reputation: 3763

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" );

Upvotes: 1

Related Questions