top.location == self.location

 if (top.location == self.location) 判断当前location 是否为顶层禁止frame引用

top表示主窗口,location表示当前窗口,如果你的文件只有一个框架,没有iframe和frmaeset,那么是完全一致的,没有区别。

top.location是在顶层frame中打开新页   window.location是在当前frame中打开新页

parent.location 在当前窗口的父窗口打开Url地址

猜你喜欢

转载自blog.csdn.net/qq_14861367/article/details/84756302