location.href的运用
2016-04-06 09:29
232 查看
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提交数据
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提交数据
相关文章推荐
- hdu 1078(记忆化搜索)
- STL之set集合容器
- HZK16应用实例
- 四则运算-安卓版
- 内存命令
- 一些jar包的作用
- 【LeetCode-154】Find Minimum in Rotated Sorted Array II
- 设定session.timeout=30后,可是不到5分钟session变量就消失了.为什么?
- ireport导出中文pdf
- [BZOJ1458]士兵占领(最大流)
- 如何查看Myeclipse的工作空间
- Android自动填充短信验证码
- 使用AFNetworking上传多组图片时遇到的error
- 很简单的JAVA反射教程
- acdreamoj1108(The kth number)
- CSS选择器权重计算规则
- 【原】Spark学习总结-六个专题
- 顺畅类
- 将GridView中的数据导出到Excel / Word中
- 139. Word Break