- 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'});
最后
以上就是正直蜡烛最近收集整理的关于js使用post请求的全部内容,更多相关js使用post请求内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复