首页 > 代码库 > js创建表单并提交

js创建表单并提交

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 = http://www.mamicode.com/PARAMS[x];        >

  

2.调用

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

 

js创建表单并提交