mtwallet
mtwallet

Reputation: 5096

What is the difference between jQuery `load(…)` and `ajax(…)` functions?

Which method should I use, load() or ajax()? This is not something I have done before, so I'm a little confused what the difference is.

Upvotes: 1

Views: 152

Answers (1)

Giorgi
Giorgi

Reputation: 30893

load() is just a shortcut for ajax() method with certain options. If you only need to fetch page and place it in the dom, you can use load() method. If you need more control over the ajax request, or you need to call it with some other options, then go for ajax().

Upvotes: 2

Related Questions