第一种
function savePayOrders(){
var id=$("#checkedOrderId").val();
var reason = $("#remark").textbox("getValue");
if(reason==null||reason==""){
commonUtil.topCenter("请填写支付理由");
return;
}
var ajaxUrl = projectPath+"/orders/payOrdersById";
$('#dlg4').dialog("close");
$.ajax({
type:"POST",
url:ajaxUrl,
data:"id="+id+"&reason="+reason,
dataType : "json",
success : function(data) {
if(data){
$("#ordersList").datagrid("reload");
$(".panel-tool-close").hide();
commonUtil.topCenter("修改成功");
}else{
commonUtil.topCenter("修改失败");
}
},
error : function(msg) {
commonUtil.topCenter("系统内部错误");
}
});
}springMVC在后台可以用两个参数接受
第二种
function savePayOrders(){
var id=$("#checkedOrderId").val();
var reason = $("#remark").textbox("getValue");
if(reason==null||reason==""){
commonUtil.topCenter("请填写支付理由");
return;
}
var ajaxUrl = projectPath+"/orders/payOrdersById";
$('#dlg4').dialog("close");
$.ajax({
type:"POST",
url:ajaxUrl,
data:"{id:"+id+",reason:"+reason+"}",
dataType : "json",
success : function(data) {
if(data){
$("#ordersList").datagrid("reload");
$(".panel-tool-close").hide();
commonUtil.topCenter("修改成功");
}else{
commonUtil.topCenter("修改失败");
}
},
error : function(msg) {
commonUtil.topCenter("系统内部错误");
}
});
}
springMVC在后台可以用对象接收