1. <% @ page language = "java" import = "java. util. *" pageEncoding = "GBK" %>
2. Background
System. out. println ("=" + baseSVo. getVName ());
String str = baseSVo. getVName ();
Try {
Str = new String (str. getBytes ("ISO8859-1"), "GBK ");
} Catch (UnsupportedEncodingException e ){
// TODO Auto-generated catch block
E. printStackTrace ();
}
System. out. println ("str =" + str );
Print result:
=== ???
Str = ???
3. Page query event: Submitted in FORM
$ ('# Search'). click (function () {// query
Document. searchform. action = "mealdate_mealdateSearch ";
Document. searchform. method = "post ";
Document. searchform. submit ();
});
4. Add or modify the ajax method.
$ ('# Save'). click (function () {// Add save to return to the main interface
Var editdDate = $ ('# edit_dDate'). val ();
If (editdDate = ''){
Alert ("select a date ");
Return false;
}
$. Ajax ({
Url: 'mealdateupdcheck ',
DataType: 'json ',
Type: 'post ',
BeforeSend: function (){},
Data :{
'Basevo. mdateid': $ ('# edit_mdateId'). val (),
'Basevo. ddate': $ ('# edit_dDate'). val (),
'Basevo. mstid': $ ('# edit_mstId'). val (),
'Usersnopassword': $ ('# usersnopassword'). val ()
},
Success: function (data ){
If (data = 'true '){
Document. editform. action = "mealdate_mealdateSearch ";
Document. searchform. method = "post ";
Document. editform. submit ();
} Else if (data = 'false '){
Alert ('Operation failed ');
Return false;
} Else {
Alert (data );
Return false;
}
}
});
});