a标签发送post请求

来源:互联网 发布:java手机版 编辑:程序博客网 时间:2024/05/22 12:46

创建一个form表单,提交该表单

<a href="javasript:void(0)" onclick=getPostUrl(url)>function getPostUrl(url,pageNo){    // 创建form,发请求    var temp = document.createElement("form");    temp.action = url;            temp.method = "post";            temp.style.display = "none";            var opt = document.createElement("input");            opt.type = "text";    opt.name = XXX;            opt.value = XXX;            temp.appendChild(opt);            document.body.appendChild(temp);            temp.submit();            return temp;}
原创粉丝点击