Jeasyui Production Planning-ajax Learning

Source: Internet
Author: User

Ajax: You can update the page without refreshing the status, and implement asynchronous commit, which improves the user's experience.

1.load () function can be used with three parameters: URL (required parameter, URL address of request HTML file, parameter type string), date (optional, send key/value data, Parameter type Object), callback (optional, A successful or failed callback function that has a parameter type of function.

Html

<input type= "button" value= "Get Data asynchronously"/>

<div id= "box" ></div>

Jquery

$ (' input '). Click (function () {

$ (' #box '). Load (' test.html '); There is only one parameter URL in the function.

});

2) pass two parameter URL and data.

Jquery

$ (' input '). Click (function () {

$ (' #box '). Load (' test.php ', {

URL: ' Ycku '

}); There are only two parameter URLs in the function and the data parameter passed in Ycku.

});

3) pass three parameter URLs and data and callback functions.

$ (' input '). Click (function () {
$ (' #box '). Load (' test.php ', {
URL: ' Ycku '
}, function (response, status, XHR) {
Alert (' return value: ' + response + ', Status: ' + Status + ', Status: ' + Xhr.statustext ');
});
});

Jeasyui Production Planning-ajax Learning

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.