top.location.href=”url” 在顶层页面打开url(跳出框架)
self.location.href=”url” 仅在本页面打开url地址
parent.location.href=”url” 在父窗口打开Url地址
this.location.href=”url” 用法和self的用法一致
if (top.location == self.location) 判断当前location 是否为顶层来 禁止frame引用
如果页面当中有自定义的frame的话,也可以将parent self top换为自定义frame的名称
效果就是在自定义frame窗口打开url地址
self.location.href=”url” 仅在本页面打开url地址
parent.location.href=”url” 在父窗口打开Url地址
this.location.href=”url” 用法和self的用法一致
if (top.location == self.location) 判断当前location 是否为顶层来 禁止frame引用
如果页面当中有自定义的frame的话,也可以将parent self top换为自定义frame的名称
效果就是在自定义frame窗口打开url地址
History历史对象并有以下方法 back() 后退,跟按下“后退”键是等效的。
forward() 前进,跟按下“前进”键是等效的。
go() 用法:history.go(x);在历史的范围内去到指定的一个地址。如果 x < 0,则后退 x 个地址,如果 x > 0,则前进 x 个地址,如果 x == 0,则刷新现在打开的网页。history.go(0) 跟 location.reload() 是等效的。
top.location.href=”url” 在顶层页面打开url(跳出框架)
self.location.href=”url” 仅在本页面打开url地址
parent.location.href=”url” 在父窗口打开Url地址
this.location.href=”url” 用法和self的用法一致
if (top.location == self.location) 判断当前location 是否为顶层来 禁止frame引用
如果页面当中有自定义的frame的话,也可以将parent self top换为自定义frame的名称
效果就是在自定义frame窗口打开url地址