JQuery ajax and jqueryajax

Source: Internet
Author: User

JQuery ajax and jqueryajax

<>

The. serialize () method creates a text string encoded with a standard URL. Its operation object is a jQuery object that represents the form Element Set.

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 


Click to submit:

Output standard query string: a = 1 & B = 2 & c = 3 & d = 4 & e = 5

If you select the check box, the output is: a = 1 & B = 2 & c = 3 & d = 4 & e = 5 & f = 8


Zookeeper
Jquery ajax usage

JQUERY:
$. Ajax ({
Type: 'post', // optional get
Url: 'action. php', // The php program that receives data.
Data: 'Data = 'dsa ', // data transmitted to PHP. Use & to connect multiple parameters.
DataType: 'text', // the data type returned by the server can be XML or Json jsonp script html text.
Success: function (msg ){
// Here is the data processing function returned by the PHP program after ajax is submitted successfully. Msg is the returned data. The data type is defined in the dataType parameter!
},
Error: function (){
Processing Function for ajax submission failure!
}
})

PHP action. php
<? Php
Echo "this is a ajax example! ";
?>

Jquery ajax usage

JQUERY:
$. Ajax ({
Type: 'post', // optional get
Url: 'action. php', // The php program that receives data.
Data: 'Data = 'dsa ', // data transmitted to PHP. Use & to connect multiple parameters.
DataType: 'text', // the data type returned by the server can be XML or Json jsonp script html text.
Success: function (msg ){
// Here is the data processing function returned by the PHP program after ajax is submitted successfully. Msg is the returned data. The data type is defined in the dataType parameter!
},
Error: function (){
Processing Function for ajax submission failure!
}
})

PHP action. php
<? Php
Echo "this is a ajax example! ";
?>

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.