window.location.href的用法(动态输出跳转)
来源:互联网 发布:快反部队知乎 编辑:程序博客网 时间:2024/06/06 20:19
javascript中的location.href有很多种用法,主要如下。
self.location.href="/url" 当前页面打开URL页面
location.href="/url" 当前页面打开URL页面
windows.location.href="/url" 当前页面打开URL页面,前面三个用法相同。
this.location.href="/url" 当前页面打开URL页面
parent.location.href="/url" 在父页面打开新页面
top.location.href="/url" 在顶层页面打开新页面
如果页面中自定义了frame,那么可将parent self top换为自定义frame的名称,效果是在frame窗口打开url地址
此外,window.location.href=window.location.href;和window.location.Reload()和都是刷新当前页面。区别在于是否有提交数据。当有提交数据时,window.location.Reload()会提示是否提交,window.location.href=window.location.href;则是向指定的url提交数据
在写ASP.Net程序的时候,我们经常遇到跳转页面的问题,我们经常使用Response.Redirect 做ASP.NET框架页跳转,如果客户要在跳转的时候使用提示,这个就不灵光了
参考自:http://www.jb51.net/article/53479.htm
0 0
- window.location.href的用法(动态输出跳转)
- window.location.href的用法(动态输出跳转)
- window.location.href的用法(动态输出跳转)
- window.location.href的用法 (动态跳转)
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- window.location.href的用法
- RSA公钥解密
- 线性筛素数
- Queue
- tomcat结合nginx使用小结
- ireport实践之request获取参数名和参数值的两种方式
- window.location.href的用法(动态输出跳转)
- 一个有成就感又有挫败感的日子
- php入门到放弃-语法
- Git的诞生
- Android手机录制音频
- Netfilter源代码分析详解
- Java基础-14总结正则表达式,Pattern,Mactcher,Math,BigInteger,BigDeximal,System等
- MySQL错误:You are using safe update mode and you tried to update a table without a WHERE that uses a K
- 配一上联