首页 > Web开发 > 详细

js创建表单并提交

时间:2017-01-12 09:20:09      阅读:152      评论:0      收藏:0      [点我收藏+]

1.脚本

	Util = {
			post : function(URL, PARAMS){ //虚拟表单实现post提交
				var temp = document.createElement("form");        
			    temp.action = URL;        
			    temp.method = "post";        
			    temp.style.display = "none";        
			    for (var x in PARAMS) {        
			        var opt = document.createElement("textarea");        
			        opt.name = x;        
			        opt.value = PARAMS[x];        
			        temp.appendChild(opt);        
			    }        
			    document.body.appendChild(temp);        
			    temp.submit();        
			    return temp;   
			}
	};

  

2.调用

Util.post(‘${rc.contextPath}/eacCoreOuterAccounting/exportData‘, queryCond);

 

js创建表单并提交

原文:http://www.cnblogs.com/yun965861480/p/6274467.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!