What is the difference between jquery $.ajax $.get $.post?

Source: Internet
Author: User

$.ajax is the jQuery underlying AJAX implementation, $.ajax is a generic underlying package, $.ajax () after requesting the data, you need to use a callback function, there are beforesend, error, Datafilter, success, complete and so on.
$.get $.post is an easy-to-use, high-level implementation, and with the $.get $.post method, jquery automatically encapsulates calls to the underlying $.ajax.
$.get only handles simple GET request functionality to replace complex $.ajax, which can be called when a request succeeds. Executing functions On error is not supported, otherwise you must use $.ajax.
$.post only handles the POST request function to replace the complex $.ajax. The callback function can be called when the request succeeds. Executing functions On error is not supported, otherwise you must use $.ajax.
$.get ("test.php", {name: "John", Time: "2pm"}) $.get method is automatically generated querystring submitted to the server (NAME=JOHN&TIME=2PM) upon request.
The data submitted by the $.post method is directly similar to the form submission, and the amount of data submitted is greater than $.get.

Excerpt--Anonymous

What is the difference between jquery $.ajax $.get $.post?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.