通过ajax提交form表单

$.ajax({
  url : 'deliveryWarrant/update.do',
  data : $('#myform').serialize(),
  type : "POST",
  success : function(data) {
    var res = eval('(' + data + ')');
    if (res && res.success == true) {
      alert(res.message);
    location.href="/godownWarrant/findToDeliveryWarrant.do?godownWarrant.code="+$("#myform input[name=godownWarrant\.code]").val();
    } else {
      alert(res.message);
    }
  }
});

原文地址:https://www.cnblogs.com/lbangel/p/3140526.html