최상위 프레임 여부 확인
JS
2008. 5. 24. 02:34
<script type="text/javascript">
<!--
function TopFrameChk(){
if( ( typeof(top.document) != "unknown" && typeof(top.document) != "undefined" )
&& (self.document.location.href != top.document.location.href || self.document.referrer != top.document.referrer)) {
top.document.location.href = self.document.location.href;
}
}
function init(){
TopFrameChk();
}
//-->
</script>
<body onload="init();">
<!--
function TopFrameChk(){
if( ( typeof(top.document) != "unknown" && typeof(top.document) != "undefined" )
&& (self.document.location.href != top.document.location.href || self.document.referrer != top.document.referrer)) {
top.document.location.href = self.document.location.href;
}
}
function init(){
TopFrameChk();
}
//-->
</script>
<body onload="init();">