欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript模擬post提交隱藏地址欄的參數(shù)

 更新時(shí)間:2014年09月03日 15:13:27   投稿:whsnow  
想要隱藏地址欄的參數(shù),就只能用javascript模擬post提交,下面是示例代碼,需要的朋友可以看看

通過(guò)js模擬post提交

1:請(qǐng)求需要的參數(shù)過(guò)長(zhǎng),超過(guò)get允許的最大長(zhǎng)度
2:想要隱藏地址欄的參數(shù)

//新創(chuàng)建一個(gè)form表單
document.write('<form name=myForm></form>'); 
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中已經(jīng)存在的form表單,添加其他的參數(shù)
var myForm = document.forms['listEmployee']; //表單的name
var input = document.createElement('input');
input.type = 'hidden';
input.name = 'currentPage';
input.value = 1;
myForm.appendChild(input);

myForm.method= 'POST';
myForm.submit();

相關(guān)文章

最新評(píng)論