window.location.href()采用post传递数据
2014-08-13 09:29
197 查看
http://colddemon.iteye.com/blog/1608132 转载地址 网上都是这个版本,原创不知道是谁 就转载他的吧
想用window.location.href跳转到另外一个界面。但直接传递get方法会暴露数据。
而用ajax或表单提交,有时在执行了方法后,无法跳转到另外的页面。
下面可以实现跳转的效果,却又能够通过post传递方法隐藏数据。
有一个不足就是,在跳转到新页面后,点击“返回”返回的是个空界面,再次点击才能返回到提交界面。 这是不足的地方,生产系统中应该不会采用此方法
但是还是记录下来
想用window.location.href跳转到另外一个界面。但直接传递get方法会暴露数据。
而用ajax或表单提交,有时在执行了方法后,无法跳转到另外的页面。
下面可以实现跳转的效果,却又能够通过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>
相关文章推荐
- window.location.href()采用post传递数据
- window.location.href以post方式传递参数
- Window.location.href以post方式传递参数的方法
- Window.location.href以post方式传递参数的方法
- window.location.href传递汉字参数
- html中使用window.location.href()跳转和传递参数。
- window.location.href传递js对象参数及获取参数
- window.location.href 跳转页面时传递参数并且在新页面接收参数
- C# 采用Basic Auth传递Post或者GET 数据
- 用window.location.href实现刷新另个框架页面
- HTML数据的传递方式:get方法 和 post 方法
- POST传递数据(VC)
- DLL(MFC)通过Window消息向C#程序传递数据
- window.location.href不起作用的原因分析
- 使用PostBackUrl传递数据
- 用window.location.href实现刷新另个框架页面
- 写通过POST方法向HTTP接口传递数据的程序
- DLL(MFC)通过Window消息向C#程序传递数据
- 用window.location.href实现刷新另个框架页面
- 用window.location.href实现页面跳转