标签:
对post提交进行封装:
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; }
调用:
post("pcGoods.do", {id :id,name:name);
标签:
原文地址:http://www.cnblogs.com/zyh1994/p/5967294.html