判断网页是否在frame中:
if(top!=this){
// 在frame中时处理
}
判断网页是否在iframe中:
if(self.frameElement.tagName==”IFRAME”){
// 页面在iframe中时处理
}