top.location != this.location 就是说当前窗体的url和父窗体的 url不相同(url主要是指是否为同一个域)
通常情况下的用法为:
if(top.location != this.location){
top.location=this.location;
}
这个主要是为了防止别的网站嵌入你的网站(比如用iframe嵌入其他网站)
top.location != this.location 就是说当前窗体的url和父窗体的 url不相同(url主要是指是否为同一个域)
通常情况下的用法为:
if(top.location != this.location){
top.location=this.location;
}
这个主要是为了防止别的网站嵌入你的网站(比如用iframe嵌入其他网站)