Interpretation of section 3 Ajax, Xin Xing jquery, 2014

Source: Internet
Author: User

Interpretation of section 3 Ajax, Xin Xing jquery, 2014

* ************** Ajax *********************

1. ajax is short for Asynchronous Javascript And XML. It refers to Asynchronous Javascript And XML. In short, it means to interact with the server without refreshing the entire page, and can be displayed on the webpage.

2. jQuery's support for Ajax is still comprehensive. It allows us to read information from the server in GET or POST mode and display it.

3. jQuery supports Ajax using the following methods.


* ************* Load method *******************

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

$ (Selector). load (URL, data, callback );

2. the URL here is the URL address to which we want to send data. The data parameter is optional. It specifies a set of query string key-value pairs sent together with the request, the optional callback parameter is the name of the function executed after the load method is complete.

3. For example, if the backend server uses php as an example, we first write an html file at the front end. The Code is as follows:

<Html> Then we need to create a new a. php file under the www directory or htdocs directory. Its content is as follows:

<? Phpecho "I am Xin Xing ";
Then we run the page. When we click the "query" button, we find that the above text has not changed, but the "click the button below to display information" is changed to "I am Xin Xing", this is a simple asynchronous transmission.


****************

1. Of course, load has other parameters. For details, refer to the manual.

2. Two other functions are also widely used, namely get and post. We will discuss them in the next section.






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.