当前页面跳转url页面: self.location.href = “/url”
当前页面跳转url页面: location.href = “/url”
当前页面跳转url页面: window.localtion.href = “/url”
当前页面跳转url页面: this.localtion.href = “/url”
在父页面打开新页面: parent.location.href = “/url”
在顶层页面打开新页面: top.location.href = “/url”
如果页面中自定义了frame,那么可将parent self top 换为自定义frame的名称,效果是在frame窗口打开url地址
此外,window.location.href=window.location.href和window.localtion.Reload()都是刷新当前页面。区别在于是否有提交数据。当有提交数据时,window.location.Reload()会是否提交
window.location.href=window.location.href; 则是向指定的url提交数据
window.localtion.href用法
最新推荐文章于 2025-03-14 10:08:43 发布