防止网页被嵌入框架(Frame)
<script type
="text/javascript">
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
;
}
</script
>
链接: http://www.ruanyifeng.com/blog/2010/08/anti-frameset_javascript_codes_continued.html.
转载请注明原文地址:https://tech.qufami.com/read-14609.html