Joe.wang
Joe.wang

Reputation: 11791

How many ways to ajax load page content in JQuery

All, I knew there is a method named load which can load dynamic content from a page in JQuery. Is there any other ways to make it ? thanks!

Upvotes: 0

Views: 71

Answers (2)

Suresh Atta
Suresh Atta

Reputation: 122008

Yes, you can use $.ajax() for asynchronous calls.

These methods perform the more common types of AJAX requests in less code.

Upvotes: 3

GolezTrol
GolezTrol

Reputation: 116140

You actually specified a link to the JQuery documentation. To the category 'Ajax' -> 'Shorthand functions' to be precise. If you go there, you see a total number of five shorthand functions:

  • get(),
  • getJSON(),
  • getScript(),
  • post() and
  • load().

All of these are a shorthand for specific uses of the single core function JQuery.ajax(), which you can also call directly.

So the answer is: 'there are six functions for Ajax, but actually it's just one'. :)

See: http://api.jquery.com/category/ajax/

Upvotes: 2

Related Questions