Dan wrote:
Okay now I have the following code but it doesn't display anything if
it is part of a parent:
I made a mess of it - look for 'tob', sheesh - early Monday ain't my
best time of the day. Forget the other post, use the stuff below.
If the script is in a document loaded into a frame, then:
<script type="text/javascript">
var o;
if ( (o = top)
&& (o = o.frames)
&& (o = o.bob)
&& (o = o.document)
&& (o = o.title)
&& o == "test"
){
document.write("yes")
} else {
document.write("no")
}
</script>
But if the script is in 'top', you can't get access to the document in
the iFrame until after the frame has loaded, so use an onload function:
<script type="text/javascript">
window.onload = function(){
var o;
if ( (o = top)
&& (o = o.frames)
&& (o = o.bob)
&& (o = o.document)
&& (o = o.title)
&& o == "test"
){
alert('bob and test found');
} else {
alert('bob or test not found');
}
}
</script>
[...]
And remember cross-domain issues with getting access to the iFrame content.
--
Rob