form表单的action提交写到js中来,同时onclick事件也写在js中来。其action也可以通过ajax来提交的。...

news/2024/7/5 6:22:40

假如你现在还在为自己的技术担忧,假如你现在想提升自己的工资,假如你想在职场上获得更多的话语权,假如你想顺利的度过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');

}

 

假如你现在还在为自己的技术担忧,假如你现在想提升自己的工资,假如你想在职场上获得更多的话语权,假如你想顺利的度过35岁这个魔咒,假如你想体验BAT的工作环境,那么现在请我们一起开启提升技术之旅吧,详情请点击http://106.12.206.16:8080/qingruihappy/index.html


http://lihuaxi.xjx100.cn/news/240536.html

相关文章

51单片机编码自学_这是9个月的自学式编码看起来像什么

51单片机编码自学by Stephen Mayeux斯蒂芬马约(Stephen Mayeux) 这是9个月的自学式编码看起来像什么 (Here’s What 9 Months of Self-Taught Coding Looks Like) 只是划伤表面 (Just Scratching the Surface) Today marks 9 months since I embarked on my journey as a self…

IE8下不识别indexOf的问题

1、为Array原型添加indexOf方法(如果学过面向对象,相当于给Array类添加实例方法),方法体如下: //添加数组IndexOf方法 if (!Array.prototype.indexOf){Array.prototype.indexOf function(elt /*, from*/){var len this.length >>> 0;var from Number(arguments[1])…

配深度学习环境要注意的不多,也就

1. 使用nvcc -V命令查看cuda版本&#xff0c;再在官网选择对应版本的pytorch。(是的不要根据python的版本去选择pytorch指令) 2. 用conda安装pytorch可能一直有cpuonly的玄学问题。(哪怕选择的是CUDA版本的pytorch安装命令)改用pip安装。 3. torchtext不会被顺带安装&#xf…

配置Tomcat和在Eclipse中创建Web工程

配置Tomcat服务器信息&#xff1a;在Tomcat的安装目录下有一个conf目录&#xff0c;里面存放着Tomcat服务器的配置文件&#xff0c;其中最为核心的配置文件是server.xml&#xff0c;在这个文件里我们可以配置服务器的各种参数&#xff0c;例如超时时间、连接数量、端口配置等等…

kvm启动报错

[rootstorage ~]# virsh -c qemu:///system list error: failed to connect to the hypervisor error: Failed to connect socket to /var/run/libvirt/libvirt-sock: No such file or directory原因&#xff1a;libvirt未启动解决方法[rootstorage ~]# libvirtd -d [rootst…

构建node.js基础镜像_在Android上构建Node.js应用程序

构建node.js基础镜像by Aurlien Giraud通过AurlienGiraud 在Android上构建Node.js应用程序-第1部分&#xff1a;Termux&#xff0c;Vim和Node.js (Building a Node.js application on Android - Part 1: Termux, Vim and Node.js) If you are excited about Node.js and own a…

python标准库介绍——23 UserString 模块详解

UserString 模块(2.0 新增) UserString 模块包含两个类, //UserString// 和 //MutableString// . 前者是对标准字符串类型的封装, 后者是一个变种, 允许你修改特定位置的字符(联想下列表就知道了).注意 //MutableString// 并不是效率很好, 许多操作是通过切片和字符串连接实现…

cloud turbine

turbine是聚合服务器发送事件流数据的一个工具&#xff0c;hystrix的监控中&#xff0c;只能监控单个节点&#xff0c;实际生产中都为集群&#xff0c;因此可以通过 turbine来监控集群下hystrix的metrics情况&#xff0c;通过eureka来发现hystrix服务。 1.断路器1 入口类 Sprin…