直接上代码: if(self.frameElement && self.frameElement.tagName=="IFRAME"){ //页面存在iframe中 }else{ //页面不存在iframe中 }