Ajax request in jquery

Source: Internet
Author: User
For Ajax requests in jquery, I did not make a statement, but provided my own real examples for your reference.
<SCRIPT type = "text/JavaScript" src = "jquery-1 [1]. 2.6.js"> </SCRIPT>
<SCRIPT>
Function button1 ()
{
$ ("# Demo"). Load ("http: // localhost/dedecmsv53/upload /");
}
Function button2 ()
{
$. Get ("jquery.htm", function (uname ){
Document. getelementbyid ("Demo"). innerhtml = uname;
});
}
Function button4 ()
{
$. Post ("jquery.htm", function (uname ){
Document. getelementbyid ("Demo"). innerhtml = uname;
});
}
Function button3 ()
{
$. Ajax ({type: "Get ",
URL: "webform1.aspx"
});
}
Function button5 ()
{
$. Getjson ("http://api.flickr.com/services/feeds/photos_public.gne? Tags = cat & tagmode = any & format = JSON & jsoncallback =? ",
Function (data ){
$. Each (data. items, function (I, item) {$ (" "). ATTR ("src", item. media. m ). appendto ("# Demo ");
If (I = 3) return false ;});});
}
Function button6 ()
{
$. Ajax ({
Contenttype: "application/JSON ",
Type: "Post ",
URL: "WebService. asmx/helloworld ",
Data: "{'name': 'zhang san '}",
Datatype: 'json ',
Success: function (msq ){
Alert (msq. D );
}
});
}
$ (Function ()
{
$ ("Div" ).css ({color: "red"}) // Style
});
</SCRIPT>
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.