jquery Read page load get post ajax Four ways code _jquery

Source: Internet
Author: User
Tags error handling
Load
Copy Code code as follows:

$ ("#result"). Load ("aaaa.asp #ccc");

Get
Copy Code code as follows:

$.get ("Aaaa.asp", {action: "Get", Name: "Lulu"},
function (data, textstatus) {
$ ("#result"). HTML (data);
alert (this);
alert (data);
alert (textstatus);
});

Post
Copy Code code as follows:

$.post ("Aaaa.asp", {action: "POST", Name: "Lulu"},
function (data, textstatus) {
$ ("#result"). HTML (data);
});

Ajax
Copy Code code as follows:

$.ajax ({
Type: "Get",
URL: "Http://www.jb51.net/rss",
Beforesend:function (XMLHttpRequest) {
$ (' <div class= quick-alert ' > Data loading, please </div> ' later)
. InsertAfter ($ ("#btn_ajax"))
. FadeIn (' slow ')
. Animate ({opacity:1.0}, 3000)
. fadeout (' Slow ', function () {
$ (this). Remove ();
//});
},
Success:function (data, textstatus) {
$ ("#result"). HTML ("");
$ ("item", data). Each (function (i, Domele) {
$ ("#result"). Append ("<li>" +$ (Domele). Children ("title"). Text () + "</li>");
});
},
Complete:function (XMLHttpRequest, Textstatus) {
Alert ("Load complete!") ");
},
Error:function () {
Request Error Handling
}
});
Related Article

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.