// 1. $. Ajax asynchronous request with JSON data
VaR AJ = $. Ajax ({
URL: 'productmanager _ reverseupdate', // jump to action
Data :{
Selrollback: selrollback,
Seloperatorscode: seloperatorscode,
Provincecode: provincecode,
Pass2: pass2
},
Type: 'post ',
Cache: false,
Datatype: 'json ',
Success: function (data ){
If (data. MSG = "true "){
// View ("modified successfully! ");
Alert ("modified successfully! ");
Window. Location. Reload ();
} Else {
View (data. msg );
}
},
Error: function (){
// View ("exception! ");
Alert ("exception! ");
}
});
// 2. $. Ajax serialize asynchronous requests whose table content is a string
Function notips (){
VaR formparam = $ ("# form1"). serialize (); // serialize the table content as a string
$. Ajax ({
Type: 'post ',
URL: 'notice _ notipsnotice ',
Data: formparam,
Cache: false,
Datatype: 'json ',
Success: function (data ){
}
});
}
// 3. $. asynchronous request for URL Splicing
VaR YZ = $. Ajax ({
Type: 'post ',
URL: 'validatepwd2 _ checkpwd2? Password2 = '+ password2,
Data :{},
Cache: false,
Datatype: 'json ',
Success: function (data ){
If (data. MSG = "false") // if the server returns false, change the value of validatepassword2 to pwd2error. This is asynchronous and the return time must be considered.
{
Textpassword2.html ("<font color = 'red'> incorrect business password! </Font> ");
$ ("# Validatepassword2"). Val ("pwd2error ");
Checkpassword2 = false;
Return;
}
},
Error: function (){}
});
// 4. $. Ajax Concatenates the asynchronous request of data
$. Ajax ({
URL: '<% = request. getcontextpath () %>/KC/kc_checkmernameunique.action ',
Type: 'post ',
Data: 'mername = '+ values,
Async: false, // The default value is true asynchronous.
Error: function (){
Alert ('error ');
},
Success: function (data ){
$ ("#" Nvidivs#.html (data );
}
});