try{
top.location.hostname;
if (top.location.hostname != window.location.hostname) {
top.location.href =window.location.href;
}
catch(e){
top.location.href = window.location.href;
防止网页被嵌套
原文:http://www.cnblogs.com/zhpblog/p/7103090.html