js中if (top.location = self.location) {top.location=self.location;}是什么意思.

来源:学生作业帮助网 编辑:作业帮 时间:2024/06/21 12:55:15
js中if (top.location = self.location) {top.location=self.location;}是什么意思.
x)*~cmfFI~^N~rbIf~BqjNP,m"i]l'xaMR>m /QSD3P醍@]/oyw竦?;Ңzwl(@gx:leḾ<\ba>'u铽 "@Ӷ֧vlÞOYV Q T­/.zF 1.

js中if (top.location = self.location) {top.location=self.location;}是什么意思.
js中if (top.location = self.location) {top.location=self.location;}是什么意思.

js中if (top.location = self.location) {top.location=self.location;}是什么意思.
top.location != self.location 就是说当前窗体的url和父窗体的 url是不是相同
如果相同执行top.location=self.location;},把窗体的url设成和本窗体一样.这个是为了防止别的网站嵌入你的网站的内容(比如用iframe嵌入的你的网站的页面)