window.location.href="url"

self.location.href="url"

this.location.href="url"

location.href="url"                    这四个跳转效果相同,表水仅在本页打开url地址

top.location.href="url"              在最外层,也就是顶层打开url地址(跳出iframe)

top.location.href="url"              在上一层父窗口打开url地址

 

 

if (top.location == self.location) 判断当前location 是否为顶层来 禁止frame引用   如果页面当中有自定义的frame的话,也可以将parent  self   top换为自定义frame的名称      效果就是在自定义frame窗口打开url地址

 

实际中可能这样使用

        if(top !== self){             top.location.href = location.href;         }   禁止frame引用

top.location.href,parent.location.href和self.location.href有什么不同?

 top.location.href,parent.location.href和self.location.href有什么不同?

top.location.href,parent.location.href和self.location.href有什么不同? top.location.href,parent.location.href和self.location.href有什么不同?

 

相关文章:

  • 2022-02-15
  • 2021-11-27
  • 2021-10-16
  • 2022-02-09
  • 2021-11-26
  • 2021-06-19
  • 2021-08-26
  • 2021-05-02
猜你喜欢
  • 2021-05-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案