当前位置: 代码迷 >> Web前端 >> Jquery传递多个参数的有关问题
  详细解决方案

Jquery传递多个参数的有关问题

热度:244   发布时间:2012-10-29 10:03:53.0
Jquery传递多个参数的问题

var parameter = {};
$("input[type=hidden]", $("form")).each(function(){
var key = this.name;
var value = this.value;
parameter[key] = value;
});

$("input[type=text]", $("form")).each(function(){
var key = this.name;
var value = this.value;
parameter[key] = value;
});

$.ajax({
async: false,
type: "POST",
url: url+"/action/manager.do",
data: parameter,
dataType: "json",
success: function(resp){
if(resp.executeSuccess == 0){
alert("<bean:message key='HC000.SAVED_SUCCESS' />");
}else{
alert("<bean:message key='HC000.SAVED_FAIL' />");
}},
error: function(msg){
alert("<bean:message key='HC000.SAVED_FAIL' />");
}
});

  相关解决方案