Detect iFrame embedding in Javascript

Looking at frame length breaks down generally if page A itself has frames (I know this might not be the case for this specific instance). The more reliable and meaningful test would be:

<script>

if (window!=window.top) {

alert(' I'm in a frame! ')

}//end if


</script>

Leave a comment