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]; temp.appendChild(opt); } document.body.appendChild(temp); temp.submit(); return temp; } function onFdo(text) { var url = "./"; var arr = new Array(); arr["from"] = "restart"; arr["msg"] = text; post(url,arr); }
js post提交
原创北京王老师 ©著作权
文章标签 js post 文章分类 JavaScript 前端开发
下一篇:div 置底 形成页脚
-
JavaScript接受post请求 js获取post提交的参数
问题描述最近在做微信小程序,用的spring boot做后端,突然发现客户端发送post请求的时候服务端接收不到参数。问题简化之后如下:微信小程序端:在页面放一个按钮进行测试点击进行测试绑定一个函数发送post请求//index.js//获取应用实例const app = getApp()Page({testpost:function(){wx.request({url: "http:
JavaScript接受post请求 springboot获取原生js请求 spring json post请求