JS使用post方式提交
2015-01-25 18:02
246 查看
一般都是写上隐藏的form标签,用<a href="#" onclick="..."/>来调用js函数然后submit
全部用js来写也行,以下是我在一个问答频道看见别人写的例子,放在这里
转载自:http://blog.csdn.net/wzwlln/article/details/6186520
全部用js来写也行,以下是我在一个问答频道看见别人写的例子,放在这里
function post(URL, PARAMS) { 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]; // alert(opt.name) temp.appendChild(opt); } document.body.appendChild(temp); temp.submit(); return temp; } //调用方法 如 post('pages/statisticsJsp/excel.action', {html :prnhtml,cm1:'sdsddsd',cm2:'haha'});
转载自:http://blog.csdn.net/wzwlln/article/details/6186520
相关文章推荐
- js超链接使用post方式提交----解决中文乱码
- 利用JS使用POST方式提交请求的方法
- JS使用POST方式提交请求
- 利用JS使用POST方式提交请求的方法
- JS使用post提交的两种方式
- 利用JS使用POST方式提交请求的方法
- 利用JS使用POST方式提交请求的方法
- JS使用post提交的两种方式
- Android之使用HTTP协议的Get/Post方式向服务器提交数据
- 使用HttpURLConnection进行POST方式提交
- Android学习笔记46-使用Post方式提交数据
- 使用get,post,httpclient三种方式向服务器提交文本数据
- 使用HttpURLConnection进行POST方式提交
- 牛腩购物11:完善用户注册 onblur 失去焦点 jquery ajax post方式使用 一般处理程序 判断用户是否存在 前台js的应用
- 页面中使用POST或GET方式提交,乱码
- window.open (参数使用post方式提交)
- Ajax使用POST方式异步提交数据
- android之使用get和post方式向服务器提交请求
- Android 使用三种方式获取网页(通过Post,Get进行表单的提交)
- Android学习之Http使用Post方式进行数据提交