假如你现在还在为自己的技术担忧,假如你现在想提升自己的工资,假如你想在职场上获得更多的话语权,假如你想顺利的度过35岁这个魔咒,假如你想体验BAT的工作环境,那么现在请我们一起开启提升技术之旅吧,详情请点击http://106.12.206.16:8080/qingruihappy/index.html
1,html脚本
<body>
<div style="display: none;">
<form id="submitForm" action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="wxOpenId" value="${wxOpenId}"/>
<input type="hidden" name="applyId" value="${applyId}"/>
<input type="hidden" name="wxModuleType" id="wxModuleType" value=""/>
</form>
</div>
<div class="fft-wrapper">
<div class="tab-wrapper">
2,通过js脚本来传递action
$(function(){
$("span.fr").click(function(){
var id = $(this).attr("id");
$("#wxModuleType").val(id);
var url = '${rc.contextPath}/wxFfanApply.htm?method=preSubPage';
document.getElementById('submitForm').action = url;
document.getElementById('submitForm').submit();
});
});
3,另一种方法就是通过ajax来序列化的传递参数,但是这时候不能是enctype="multipart/form-data"这种格式的,如果非得这样传的话见springmvc + ajaxfileupload解决ajax不能异步上传图片的问题
$(function() {
$(".btn-submit").click(function() {
var url = '${rc.contextPath}/wxFfanApply.htm?method=save';
var param = $("#submitForm").serialize();
$.post(url, param, function(data) {
alert("jjjjj");
}, 'json');
}