首页 > 语言 > JavaScript > 正文

jquery提交form表单简单示例分享

2024-05-06 14:28:52
字体:
来源:转载
供稿:网友

代码如下:
$.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="/form.php?godownWarrant.code="+$("#myform input[name=godownWarrant//.code]").val();
    } else {
      alert(res.message);
    }
  }
});

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选