//检测是否在iframe中
if(self.frameElement != null && (self.frameElement.tagName == "IFRAME" || self.frameElement.tagName == "iframe")){
parent.parent.location = "login.jsp";
}
转载于:https://www.cnblogs.com/kenkofox/archive/2011/06/16/2082851.html