摘要:
知识补充:window.location.href、location.href、self.location.href 是本页面地址parent.location.href;上一层页面地址top.location.href:最外层的页面地址方式1:if(window.top.location != window.self.location){ alert('I am in the iframe'); window.top.location = window.self.location; }方式2://dom对象可以检测是否相等,而js对象则直接不可以window===windo. 阅读全文