Click to See Complete Forum and Search --> : Frames Support?


AWhiteC
02-28-2003, 05:26 PM
Is there a way in JavaScript to tell whether the browser supports Frames (or has Frames handling enabled)?

AWhiteC
03-01-2003, 11:35 AM
Thanks for that, Dave, but it doesn't quite solve my problem.

What I need is a way to find out in a non-frames HTML document whether the browser handles frames!

Timbuck2
03-01-2003, 06:33 PM
Maybe something along this line ?
function supportsFrames()
{var retVal = document.frames
return retVal == "[object]"
}
function init()
{alert (supportsFrames())
}
but add error checing

Charles
03-01-2003, 08:52 PM
The simple version of that is:

<script type="text/javascript">
<!--
alert (Boolean(document.frames));
// -->
</script>

But you will find that it doesn't work. The document.frames object exists even when the browser doesn't support frames.