使用ajax提交表单同时提交其他参数的写法

使用ajax提交表单同时提交其他参数的写法

参考

https://blog.csdn.net/jiangyu1013/article/details/72179611

function savePlanTask() {
var form_addServiceInfoAll = $("#form_addServiceInfoAll").serialize();//将表单实例化,下面传参要用
	$.ajax({
		url : baseUrl + '/proj/projsetList1/savePlanTask',
		type : "POST",
		//data : $("#form_addServiceInfoAll").serialize();
		data : form_addServiceInfoAll+"&userid="+userId,//传递数据直接将上面定义的表单写上,后面拼接要传递的参数名及参数
		cache : false,
		async : false,
		dataType : 'json',
		success : function(data) {
			window.location.reload();
		}
	});
}

猜你喜欢

转载自blog.csdn.net/qq_43137849/article/details/85233666