“关闭 “当前的iFrame是不可能的,但你可以告诉父级来操作dom并使其不可见。
In Iframe:
parent.claseIframe();
In parent:
function closeIframe() {
$('#youriframeid').remove();
}
检测iframe的层级,并判断是否跳出并从定向:
if(window.top != window.self){
top.location.href = location.href;
}