javascript-js模拟form页面提交跳转

window.location.href跳转到另外一个界面。但直接传递get方法会暴露数据

下面可以实现跳转的效果,却又能够通过post传递方法隐藏数据。 
有一个不足就是,在跳转到新页面后,点击“返回”返回的是个空界面,再次点击才能返回到提交界面。 

<script language=javascript>   
document.write("<form action=abc.action method=post name=form1 style='display:none'>");  
document.write("<input type=hidden name=name value='"+username+"'/>"); 
document.write("</form>");
document.form1.submit();
</script>
原文地址:https://www.cnblogs.com/bjlhx/p/6673053.html