2014 Sinsing jquery reading section III Ajax

Source: Internet
Author: User

ajax*********************

1.Ajax is a shorthand for asynchronous JavaScript and XML, which refers to asynchronous JavaScript and XML, which simply means that the entire page is not flushed and the server side interacts with the data and can be displayed on the Web page.

The 2.jQuery support for Ajax is perfect, and it allows us to read the information from the server in a GET or post manner and display it.

3.jQuery supports Ajax in several ways.


Load Method *******************

The 1.load method loads the data from the server and puts the returned data into the selected element in the syntax format:

$ (selector). Load (url,data,callback);

2. The URL here is the URL that we want to send the data to, the parameter is optional, it specifies a collection of query string key-value pairs sent with the request, and the optional callback parameter is the name of the function executed after the Load method completes.

3. For example, our background server in PHP, for example, we first write a foreground HTML file, the code is as follows:

Then we also need to create a new a.php file in the WWW directory or the Htdocs directory, which reads as follows:

<?phpecho "I am Sinsing";
Then we run the page, when we click on the "Query" button, we found that the above text does not change, but "click on the button below to display information" has become "I am Sinsing", this is a simple asynchronous transfer.


Description ****************

1. Load also has other parameters, which can be referenced in the manual.

2. There are also two function applications that are also very extensive, that is get and post, which we'll cover in the next section.



2014 Sinsing jquery reading section III Ajax

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.