您好,欢迎访问一九零五行业门户网

javascript模拟post提交隐藏地址栏的参数_javascript技巧

通过js模拟post提交
1:请求需要的参数过长,超过get允许的最大长度
2:想要隐藏地址栏的参数
//新创建一个form表单document.write(''); var myform=document.forms['myform']; myform.action='runempattendance'; myform.method='post'; var input = document.createelement('input');input.type = 'text';input.name = 'userid';input.value = 100;myform.appendchild(input);myform.submit();//使用jsp中已经存在的form表单,添加其他的参数var myform = document.forms['listemployee']; //表单的namevar input = document.createelement('input');input.type = 'hidden';input.name = 'currentpage';input.value = 1;myform.appendchild(input);myform.method= 'post';myform.submit();
其它类似信息

推荐信息