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! ";
?>